home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume26 / tulp-3.0.3 / part01 next >
Encoding:
Text File  |  1993-04-15  |  91.5 KB  |  3,157 lines

  1. Newsgroups: comp.sources.unix
  2. From: Christophe.Wolfhugel@univ-lyon1.fr (Chris Wolfhugel)
  3. Subject: v26i160: tulp-3.0.3 - a listserv-like mailing list manager, V3.0.3, Part01/02
  4. Sender: unix-sources-moderator@vix.com
  5. Approved: paul@vix.com
  6.  
  7. Submitted-By: Christophe.Wolfhugel@univ-lyon1.fr (Chris Wolfhugel)
  8. Posting-Number: Volume 26, Issue 160
  9. Archive-Name: tulp-3.0.3/part01
  10.  
  11. TULP is a mailing-lists manager.  It implements a subset of the commands of
  12. the well known LISTSERV, used mainly in the Bitnet world.  It can  also  be
  13. used, in a very limited manner, as a mail-server for text archives.
  14.  
  15. TULP allows an easy management of mailing-lists.  Once their are created by
  16. the   TULP-manager,  users  can  subscribe,   signoff,  get  the   list  of
  17. subscribers, or retrieve  past articles  by sending mail  to  an  automatic
  18. sofware,  typically  listserv@node.dom.ain.  The  implemented commands  are
  19. really  close  to  the  syntax  used  on  Bitnet-Listserv  running  on  IBM
  20. mainframes.  Note  that  there is  *no*  connection  between  the  original
  21. listserv running on IBM mainframes and TULP.
  22.  
  23. Each list can have several attributes:
  24.  
  25. + Multiple list status: public, private, moderated.
  26.  
  27. + List of owners an an editor.
  28.  
  29. + Mutliple "review" status: public, private, owners.
  30.  
  31. + Multiple subscription schemes: public, owners, closed.
  32.  
  33. + Messages numbering (optional).
  34.  
  35. + Messages archival (on a monthly basis, optional).
  36.  
  37. TULP  is interfaced with  the Sendmail MTA  in the  released version but it
  38. should also be easily adaptable to other mail transport agents.
  39.  
  40. TULP has successfully been tested and  is currently  already in  production
  41. under following systems:
  42.  
  43.         AIX 3.1 & 3.2
  44.     A/UX 3
  45.         HP-UX 8.0
  46.         SunOS 4.1
  47.         SVR4 3.0
  48.  
  49. TULP is distributed under the GNU General Public License.
  50.  
  51.     Kimmo.Suominen@lut.fi (Kimmo Suominen)
  52.     Christophe.Wolfhugel@univ-lyon1.fr (Chris Wolfhugel)
  53.  
  54. #! /bin/sh
  55. # This is a shell archive.  Remove anything before this line, then unpack
  56. # it by saving it into a file and typing "sh file".  To overwrite existing
  57. # files, type "sh file -c".  You can also feed this as standard input via
  58. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  59. # will see the following message at the end:
  60. #        "End of archive 1 (of 2)."
  61. # Contents:  ANNOUNCE AUTHORS COPYRIGHT INSTALL MANIFEST Makefile
  62. #   PATCHES README VERSIONS WHERE WORKING ad.c ad.h conf.h deliver
  63. #   ext.h fakesyslog.c fakesyslog.h helpfile internal.h k.c l.h lc.h
  64. #   lists lp.c lp.h messages.h popen.c popen.h rc.tulp str.c str.h
  65. #   test.u test.w tulp.5 tulp.8 vers.c
  66. # Wrapped by vixie@gw.home.vix.com on Thu Apr 15 18:34:02 1993
  67. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  68. if test -f 'ANNOUNCE' -a "${1}" != "-c" ; then 
  69.   echo shar: Will not clobber existing file \"'ANNOUNCE'\"
  70. else
  71. echo shar: Extracting \"'ANNOUNCE'\" \(4145 characters\)
  72. sed "s/^X//" >'ANNOUNCE' <<'END_OF_FILE'
  73. X[ comp.sources.unix note -- this is really 3.0.3, but this announcement text
  74. X  has not been updated by the author.                    --vix ]
  75. X
  76. Newsgroups: comp.mail.misc
  77. Subject: Announcement: TULP 3.0.1 (mailing list manager) for Unix
  78. Summary: TULP is a listserv-like application running on Unix stations
  79. X
  80. X                The Unix Listserv Program - TULP
  81. X
  82. X                 Version 3.0.1 - November 1992
  83. X
  84. X
  85. TULP is a mailing-lists manager.  It implements a subset of the commands of
  86. the well known LISTSERV, used mainly in the Bitnet world.  It can  also  be
  87. used, in a very limited manner, as a mail-server for text archives.
  88. X
  89. This version brings many  improvements to the 2.00 released last June  (see
  90. below).
  91. X
  92. TULP allows an easy management of mailing-lists.  Once their are created by
  93. the   TULP-manager,  users  can  subscribe,   signoff,  get  the   list  of
  94. subscribers, or retrieve  past articles  by sending mail  to  an  automatic
  95. sofware,  typically  listserv@node.dom.ain.  The  implemented commands  are
  96. really  close  to  the  syntax  used  on  Bitnet-Listserv  running  on  IBM
  97. mainframes.  Note  that  there is  *no*  connection  between  the  original
  98. listserv running on IBM mainframes and TULP.
  99. X
  100. XEach list can have several attributes:
  101. X
  102. X+ Multiple list status: public, private, moderated.
  103. X
  104. X+ List of owners an an editor.
  105. X
  106. X+ Mutliple "review" status: public, private, owners.
  107. X
  108. X+ Multiple subscription schemes: public, owners, closed.
  109. X
  110. X+ Messages numbering (optional).
  111. X
  112. X+ Messages archival (on a monthly basis, optional).
  113. X
  114. TULP  is interfaced with  the Sendmail MTA  in the  released version but it
  115. should also be easily adaptable to other mail transport agents.
  116. X
  117. TULP has successfully been tested and  is currently  already in  production
  118. under following systems:
  119. X
  120. X        AIX 3.1 & 3.2
  121. X    A/UX 3
  122. X        HP-UX 8.0
  123. X        SunOS 4.1
  124. X        SVR4 3.0
  125. X
  126. TULP is distributed under the GNU General Public License.
  127. X
  128. The package  is available  by anonymous  ftp  at  several  places.  If  you
  129. decide  to  put the  package and  its updates  available by  anonymous ftp, 
  130. please drop me a note so that I can add your site name to the documentation.
  131. X
  132. X--- Author's sites -------------------------------------------------
  133. X
  134. Anonymous ftp to grasp1.univ-lyon1.fr         [134.214.100.25]
  135. X   /pub/unix/mail/listserv/tulp-3.0.1.tar.Z
  136. X
  137. Anonymous ftp to lut.fi                       [157.24.10.8]
  138. X   /pub/tulp/tulp-3.0.1.tar.Z
  139. X
  140. X--- Other shadowing sites ------------------------------------------
  141. X
  142. Anonymous ftp to nic.funet.fi                 [128.214.6.100]
  143. X   /pub/unix/mail/servers/tulp-3.0.1.tar.Z
  144. X
  145. Anonymous ftp to ftphost.comp.vuw.ac.nz        [130.195.5.12]
  146. X   /pub/mail/tulp-3.0.1.tar.Z
  147. X
  148. Anonymous ftp to ftp.vifp.monash.edu.au         [130.194.124.128]
  149. X   /pub/src/mail/tulp-3.0.1.tar.Z
  150. X
  151. Anonymous ftp to ftp.zrz.tu-berlin.de         [130.149.4.50]
  152. X   /pub/mail/server/tulp/tulp-3.0.1.tar.Z
  153. X
  154. If you don't have anonymous ftp access you can retrieve the package through
  155. e-mail by sending the following command to <listserv@grasp1.univ-lyon1.fr>:
  156. X
  157. GET TULP tulp-3.0.1.uue
  158. X
  159. An uuencoded file will be sent  to  you.   Note that the command must be in
  160. the body of your message, not in the subject.
  161. X
  162. If you wish  to be  informed of releases of new versions or patches you may 
  163. subscribe  to  the  "tulp-dist"  mailing  list.  To  do  so,  send  a  mail 
  164. to <listserv@grasp1.univ-lyon1.fr> with a command like:
  165. X
  166. sub tulp-dist Firstname Lastname
  167. X
  168. The  command must not be in the  subject of the mail but in the body of the 
  169. message.  This list will only be informed of new released, discussion about
  170. about TULP goes to the list described below.
  171. X
  172. A discussion list for TULP and listservs for  Unix in general  also exists.
  173. The list  name  is  <listnix@grasp1.univ-lyon1.fr>.  If  you wish to  join,
  174. commands must be sent to listserv@grasp1.univ-lyon1.fr:
  175. X
  176. XExample:
  177. SUB listnix Chris Wolfhugel
  178. X
  179. Any questions/comments are welcome by mail or to the list.
  180. X
  181. Modifications  since  release  2.00: mainly a design change in how the mail
  182. is delivered and handled as well as some bugfixes and cleanup work.
  183. X
  184. Kimmo Suominen   <Kimmo.Suominen@lut.fi>
  185. Chris Wolfhugel  <Christophe.Wolfhugel@univ-lyon1.fr>
  186. END_OF_FILE
  187. if test 4145 -ne `wc -c <'ANNOUNCE'`; then
  188.     echo shar: \"'ANNOUNCE'\" unpacked with wrong size!
  189. fi
  190. # end of 'ANNOUNCE'
  191. fi
  192. if test -f 'AUTHORS' -a "${1}" != "-c" ; then 
  193.   echo shar: Will not clobber existing file \"'AUTHORS'\"
  194. else
  195. echo shar: Extracting \"'AUTHORS'\" \(603 characters\)
  196. sed "s/^X//" >'AUTHORS' <<'END_OF_FILE'
  197. X$Id: AUTHORS,v 1.3 92/09/28 21:06:56 wolf Exp $
  198. X
  199. The following persons have contributed to the developement of the
  200. Listserv software:
  201. X
  202. Kimmo Suominen <Kimmo.Suominen@lut.fi>
  203. X        POSIX features, startup & deliver scripts.
  204. X    gethostname, uname stuff.
  205. X    General portability enhencements.
  206. X    Malloc stuff rewritten & corrected
  207. X
  208. Christophe Wolfhugel <Christophe.Wolfhugel@univ-lyon1.fr>  (as himself)
  209. X        Initial application.
  210. X    Enchancements 2.0 -> 3.0.
  211. X
  212. Christophe Wolfhugel <Christophe.Wolfhugel@hsc-sec.fr>    (for his boss)
  213. X    Moderators, list flags, etc...
  214. X    Windowed pipe handling,
  215. X    Lots of enhencements.
  216. END_OF_FILE
  217. if test 603 -ne `wc -c <'AUTHORS'`; then
  218.     echo shar: \"'AUTHORS'\" unpacked with wrong size!
  219. fi
  220. # end of 'AUTHORS'
  221. fi
  222. if test -f 'COPYRIGHT' -a "${1}" != "-c" ; then 
  223.   echo shar: Will not clobber existing file \"'COPYRIGHT'\"
  224. else
  225. echo shar: Extracting \"'COPYRIGHT'\" \(1099 characters\)
  226. sed "s/^X//" >'COPYRIGHT' <<'END_OF_FILE'
  227. X$Id: COPYRIGHT,v 1.3 92/06/12 06:52:53 listserv Exp $
  228. X
  229. XFollowing Copyright applies, except for the special cases indicated
  230. above.
  231. X
  232. Copyright (C) 1991, Christophe Wolfhugel     as himself
  233. X                    Email:  Christophe.Wolfhugel@univ-lyon1.fr
  234. X
  235. Copyright (C) 1992, Kimmo Suominen           as himself
  236. X                    Email:  Kimmo.Suominen@lut.fi
  237. X
  238. Copyright (C) 1992, Christophe Wolfhugel & Herve Schauer Consultants
  239. X                    Email:  Christophe.Wolfhugel@hsc-sec.fr
  240. X                Christophe.Wolfhugel@univ-lyon1.fr
  241. X
  242. X
  243. Please see the document LICENCE for the conditions of use.
  244. X
  245. X
  246. X--- Special cases ------------------------------------------------------------
  247. X
  248. XExcept for fakesyslog, where the copyright belongs to their original
  249. authors (Stan Barber is one of those, but unfortunately I forgot the
  250. name of the second one).
  251. X
  252. fakesyslog has been taken from the NNTP package (with authorization).
  253. X
  254. XExcept for popen.c, where the copyright belongs to their original
  255. authors (The regents of the University of California).
  256. The module popen.c has been slightly modified to fit listserv's needs.
  257. END_OF_FILE
  258. if test 1099 -ne `wc -c <'COPYRIGHT'`; then
  259.     echo shar: \"'COPYRIGHT'\" unpacked with wrong size!
  260. fi
  261. # end of 'COPYRIGHT'
  262. fi
  263. if test -f 'INSTALL' -a "${1}" != "-c" ; then 
  264.   echo shar: Will not clobber existing file \"'INSTALL'\"
  265. else
  266. echo shar: Extracting \"'INSTALL'\" \(7126 characters\)
  267. sed "s/^X//" >'INSTALL' <<'END_OF_FILE'
  268. X                     The Unix Listserv Program
  269. X                          Version 3.0.0
  270. X                 Installation and Operations Guide
  271. X
  272. X     Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  273. X
  274. X1) Installation / Customization
  275. X
  276. X- Create a user named "listserv" on your system, preferably in its own
  277. X  group (this makes it easier to give access to maintenance users).
  278. X  You may of course choose another user if you wish.
  279. X
  280. X  The user should *not* have any special privileges. It is *not* an
  281. X  administrative user.
  282. X
  283. X  You may wish to disable logins on that account, and allow access
  284. X  only with rlogin (to avoid having a shared password).
  285. X
  286. X  It is also a nice idea to put listserv's home directory on a stable
  287. X  file system, ie. where there are few risks of running out of space.
  288. X  In the current release, TULP gives an undefined (which could be
  289. X  mail loops, but we did not test this) behavior if the file system it's
  290. X  running on is full. Do not put the directory on a file system
  291. X  which is vital for the system.
  292. X
  293. X  Create the directory expl in listserv's home directory. If you
  294. X  prefer using another organization, you'll have to change the
  295. X  adequate defines in conf.h and Makefile.
  296. X
  297. X  TULP's binaries and scripts will be put in /usr/local/etc, all
  298. X  service files will be in ~/expl and we suggest that you put
  299. X  the sources in ~/src.
  300. X
  301. X- Login as root and create some mail aliases (described method
  302. X  is for Sendmail). Aliases are generally stored in /usr/lib/aliases
  303. X  or /etc/aliases, some sites may have another location, anyway the
  304. X  system administrator should know about it.
  305. X
  306. X  You must create 3 service aliases:
  307. X     listman:          address of the listserv manager (you!)
  308. X     listserv-request: listman
  309. X     list-errors:      where errors should be reported (generally also you).
  310. X  These two aliases must of course *not* point to Listserv otherwise you'll
  311. X  create a deadly loop.
  312. X
  313. X  If you have decided not to use the -request facility in conf.h then
  314. X  you do not need the listserv-request alias. It is strongly
  315. X  discouraged not to use the -request facility.
  316. X
  317. X  Ask your system administrator to add "listserv" to the list of
  318. X  trusted users, with Sendmail this will allow listserv to send mail
  319. X  while defining the appropriate From envelope. With other MTAs,
  320. X  please consult their manuals in order to arrive to the same result.
  321. X
  322. X  If you wish to use the test list, also add an alias:
  323. X     test:          "|/usr/local/etc/deliver test"
  324. X
  325. X  And finally alias listserv to the deliver package:
  326. X     listserv:      "|/usr/local/etc/deliver listserv"
  327. X
  328. X- Issue a newaliases in order to refresh the database. Also rebuild
  329. X  your frozen Sendmail configuration file if any. The Sendmail
  330. X  daemon should be restarted in order to be sure that all modifications
  331. X  have been taken into account.
  332. X
  333. X- You'll now have to edit the configuration file conf.h in order to
  334. X  set the parameters according to your system and to your wishes.
  335. X
  336. X  Parse this file carefully in order not to miss anything. If in
  337. X  future runs you see CPU loops on the Listserv process then maybe
  338. X  there is a problem with the signal handling on your system.
  339. X  In this case you may wish to define NO_SIGUSR1 in conf.h, you'll
  340. X  also need to modify the 'deliver' script in order to have it
  341. X  not calling 'kilst' anymore'.
  342. X
  343. X- Edit helpfile in order to fill it in with your local adresses.
  344. X  You can also add whatever you'd like to. For example, on my
  345. X  production version on grasp1.univ-lyon1.fr I have explanations
  346. X  on how to retrieve the FAQ archives via the listserv.
  347. X
  348. X- Check and modify Makefile according to your system. On AIX 3.1,
  349. X  -D_BSD does not need to be added (if you have compilation errors,
  350. X  then it's that you have wrong options).
  351. X
  352. X  Don't forget to put the proper directories.
  353. X
  354. X- Edit and customize 'deliver' and 'rc.tulp' according to your
  355. X  system.
  356. X
  357. X- Issue 'make all' in order to compile all the stuff.
  358. X
  359. X- Once compiled and linked successfully, issue a make 'install'.
  360. X  That will copy the executables and scripts to the right place.
  361. X
  362. X  Verify that 'kilst' is setuid to listserv (no danger, check the source
  363. X  to get the confirmation).
  364. X
  365. X
  366. X- Copy helpfile, lists and test.* to ~/expl. If you wish to
  367. X  create new lists, refer to the latter comments and also to tulp(5).
  368. X
  369. The installation of TULP in now ready, you can now create your lists
  370. and start the application.
  371. X
  372. X
  373. X2) Running TULP
  374. X
  375. TULP should be started preferably with the /usr/local/etc/rc.tulp
  376. script.
  377. X
  378. The daemon should immediately go into background (except if DEBUG was
  379. defined in the Makefile). You should now have the 'test' list ready
  380. for use with one subscriber: the list-manager (listman).
  381. X
  382. Important eventss are filed to the syslog or to the fakesyslog you have
  383. defined.
  384. X
  385. The world-readable file /usr/local/etc/tulp.pid exists as long as the
  386. listserv is active. It's there to indicate the current pid to the
  387. kilst program.
  388. X
  389. You may wish to create a file listname.n in order to enable the
  390. usage of the X-Sequence: field in the header of the resent messages.
  391. X
  392. X
  393. X3) Listserv shutdown
  394. X
  395. Normal shutdown is obtained when sending kill -15 to the listserv pid.
  396. shutdown generally does not take more than a few seconds, but when
  397. relaying a message it can be much longer.
  398. X
  399. X
  400. X4) Creating a list (delete is reverse operation)
  401. X
  402. Creating a list is easy.
  403. X
  404. X- Choose the list name in order to be at most MAX_FILE-2 long (this name
  405. X  if called 'listname' for the following text).
  406. X
  407. X  In fact it should not be longer than 12 characters as, too bad,
  408. X  Posix only requires 14 characters long filenames. If the names
  409. X  are longer, you'll be system specific.
  410. X
  411. X- Go to ~/expl and create 'listname.w' containing the welcome
  412. X  message that will be sent to every new subscriber.
  413. X  Create 'listname.u' and put in it any user you wish to subscribe
  414. X  immediately (see test.u format), otherwise just 'touch listname.u'.
  415. X  The file *must* exist. Create the file listname.n if you wish
  416. X  to have Sequence numbers.
  417. X  If you wish to have archiving, issue 'mkdir listname'.
  418. X  Verify that these files are mode 700.
  419. X
  420. X  Customize the header of list.u (see file tulp(5)) according to your
  421. X  needs.
  422. X
  423. X- The file list.n, if existing contains the number (in text) of the next
  424. X  message. If present, the X-Sequence: field will be added to every
  425. X  forwarded message.
  426. X
  427. X- Edit the file lists and add the new list if you wish to have that list
  428. X  appear in the catalog.
  429. X
  430. X- Edit (as root) /usr/lib/aliases and alias the new list name to the
  431. X  deliver script and refresh the aliases database.
  432. X  Also put the -request alias (to a human) if you have choosen
  433. X  the adequate compilation option in conf.h.
  434. X  Exemple:
  435. X        tulp:           "|/usr/local/etc/deliver tulp"
  436. X        tulp-request:   listman
  437. X
  438. The new list is ready, you don't need to restart the listserv.
  439. X
  440. Don't forget to subscribe to the new list, specifying address 'listname@host'
  441. as subscriber email.
  442. X
  443. X
  444. X5) Miscellaneous
  445. X
  446. This listserv is used successfully in coordination with C-News in order
  447. to establish a full bi-directionnal gateway between mailing lists and
  448. Usenet newsgroups. This works fine only if listserv if the 'head' of
  449. the gatewayed list/group.
  450. END_OF_FILE
  451. if test 7126 -ne `wc -c <'INSTALL'`; then
  452.     echo shar: \"'INSTALL'\" unpacked with wrong size!
  453. fi
  454. # end of 'INSTALL'
  455. fi
  456. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  457.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  458. else
  459. echo shar: Extracting \"'MANIFEST'\" \(1354 characters\)
  460. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  461. X   File Name        Archive #    Description
  462. X-----------------------------------------------------------
  463. X ANNOUNCE                   1    
  464. X AUTHORS                    1    
  465. X COPYRIGHT                  1    
  466. X INSTALL                    1    
  467. X LICENCE                    2    
  468. X MANIFEST                   1    This shipping list
  469. X Makefile                   1    
  470. X PATCHES                    1    
  471. X README                     1    
  472. X VERSIONS                   1    
  473. X WHERE                      1    
  474. X WORKING                    1    
  475. X ad.c                       1    
  476. X ad.h                       1    
  477. X conf.h                     1    
  478. X deliver                    1    
  479. X ext.h                      1    
  480. X fakesyslog.c               1    
  481. X fakesyslog.h               1    
  482. X helpfile                   1    
  483. X internal.h                 1    
  484. X k.c                        1    
  485. X l.c                        2    
  486. X l.h                        1    
  487. X lc.c                       2    
  488. X lc.h                       1    
  489. X lists                      1    
  490. X lp.c                       1    
  491. X lp.h                       1    
  492. X messages.h                 1    
  493. X popen.c                    1    
  494. X popen.h                    1    
  495. X rc.tulp                    1    
  496. X str.c                      1    
  497. X str.h                      1    
  498. X test.u                     1    
  499. X test.w                     1    
  500. X tulp.5                     1    
  501. X tulp.8                     1    
  502. X vers.c                     1    
  503. END_OF_FILE
  504. if test 1354 -ne `wc -c <'MANIFEST'`; then
  505.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  506. fi
  507. # end of 'MANIFEST'
  508. fi
  509. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  510.   echo shar: Will not clobber existing file \"'Makefile'\"
  511. else
  512. echo shar: Extracting \"'Makefile'\" \(3473 characters\)
  513. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  514. X# $Id: Makefile,v 1.12 92/12/04 07:40:48 wolf Exp $
  515. X#-------------------------------------------------------------------------
  516. X#  Listserv - Unix Mailing List manager (sub-set of FRECP's
  517. X#             Bitnet Listserv tool).
  518. X#
  519. X#  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  520. X#
  521. X#  Please read the files COPYRIGHT and AUTHORS for the extended
  522. X#  copyrights refering to this file.
  523. X#
  524. X#  This program is free software; you can redistribute it and/or modify
  525. X#  it under the terms of the GNU General Public License as published by
  526. X#  the Free Software Foundation; either version 1, or (at your option)
  527. X#  any later version.
  528. X#
  529. X#  This program is distributed in the hope that it will be useful,
  530. X#  but WITHOUT ANY WARRANTY; without even the implied warranty of
  531. X#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  532. X#  GNU General Public License for more details.
  533. X#
  534. X#  You should have received a copy of the GNU General Public License
  535. X#  along with this program; if not, write to the Free Software
  536. X#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  537. X#
  538. X#----------------------------------------------------------------------
  539. X#
  540. X# Generic flags
  541. CC    =       cc
  542. X#CC    =    gcc #-Wall  # I do not have gcc so attend lots of warnings
  543. CFLAGS    =       -O
  544. LDFLAGS    =    -O
  545. X# If your linker needs some...
  546. X#LIBS    =       
  547. X#
  548. X# AIX does not require any special LIB. Use the standard cc also.
  549. X#
  550. X# Apple A/UX 3 (junk Unix) needs Posix options and you'll have to replace
  551. X# a u_int by unsigned int in popen.c, I forgot that on the patch. Another
  552. X# good solution would be to get a real Unix system.
  553. X#CFLAGS =    -ZP
  554. X#
  555. X# On HP-UX
  556. X#CFLAGS    =    -Aa -D_HPUX_SOURCE -O
  557. X#
  558. X# SVR4 requires following libraries
  559. LIBS    =    -lsocket -lnsl
  560. X
  561. X# Directory where the binaries and other stuff will reside
  562. INSTDIR    =    /usr/local/etc/tulp
  563. MAN5    =    /usr/share/man/man5
  564. MAN8    =    /usr/share/man/man8
  565. X
  566. X# User and group to whome INSTDIR should belong, USER must be the
  567. X# user under which TULP will be running.
  568. USER    =    listserv
  569. GROUP    =    listserv
  570. X
  571. X# Path to your system's Berkeley install program 
  572. INSTALL    =    /usr/ucb/install
  573. X
  574. X#---- Stop you should not need to modify anything below ---
  575. X
  576. XEXE    =    listserv kilst
  577. UTILS    =    Makefile
  578. X#
  579. SRC    =    l.c lc.c lp.c str.c ad.c vers.c k.c fakesyslog.c popen.c
  580. OBJ1    =    l.o lc.o lp.o str.o ad.o vers.o fakesyslog.o popen.o
  581. OBJ2    =    k.o
  582. INC    =    conf.h ext.h ad.h fakesyslog.h l.h lc.h lp.h popen.h str.h
  583. X
  584. X# Standard targets
  585. X
  586. all: listserv kilst
  587. X
  588. listserv: $(OBJ1)
  589. X    $(CC) $(LDFLAGS) -o listserv $(OBJ1) $(LIBS)
  590. X
  591. kilst: $(OBJ2)
  592. X    $(CC) -o kilst $(OBJ2)
  593. X
  594. lint:
  595. X    lint $(SRC)
  596. X
  597. install: listserv kilst deliver rc.tulp tulp.5 tulp.8
  598. X    -mkdir $(INSTDIR); chmod 755 $(INSTDIR)
  599. X    chown $(USER) $(INSTDIR); chgrp $(GROUP) $(INSTDIR)
  600. X    $(INSTALL) -g $(GROUP) -o $(USER) -m 711 listserv $(INSTDIR)
  601. X    $(INSTALL) -g $(GROUP) -o $(USER) -m 4711 kilst $(INSTDIR)
  602. X    $(INSTALL) -g $(GROUP) -o $(USER) -m 755 deliver $(INSTDIR)
  603. X    $(INSTALL) -g $(GROUP) -o $(USER) -m 755 rc.tulp $(INSTDIR)
  604. X    $(INSTALL) -g bin -o bin -m 444 tulp.5 $(MAN5)
  605. X    $(INSTALL) -g bin -o bin -m 444 tulp.8 $(MAN8)
  606. X
  607. clean:
  608. X    rm -f $(EXE) $(OBJ1) $(OBJ2)
  609. X
  610. X# Dependencies
  611. X
  612. ad.o: conf.h ext.h internal.h
  613. fakesyslog.o: conf.h fakesyslog.h internal.h
  614. k.o: conf.h internal.h
  615. l.o: conf.h ext.h lp.h str.h popen.h ad.h lc.h fakesyslog.h internal.h
  616. lc.o: conf.h ext.h l.h lp.h messages.h str.h popen.h fakesyslog.h internal.h
  617. lp.o: conf.h ext.h str.h fakesyslog.h internal.h
  618. popen.o: conf.h fakesyslog.h internal.h
  619. str.o: conf.h internal.h
  620. vers.o: conf.h internal.h
  621. END_OF_FILE
  622. if test 3473 -ne `wc -c <'Makefile'`; then
  623.     echo shar: \"'Makefile'\" unpacked with wrong size!
  624. fi
  625. # end of 'Makefile'
  626. fi
  627. if test -f 'PATCHES' -a "${1}" != "-c" ; then 
  628.   echo shar: Will not clobber existing file \"'PATCHES'\"
  629. else
  630. echo shar: Extracting \"'PATCHES'\" \(90 characters\)
  631. sed "s/^X//" >'PATCHES' <<'END_OF_FILE'
  632. X17-Nov-1992        3.0.0  to  3.0.1
  633. X04-Dec-1992        3.0.1  to  3.0.2
  634. X15-Mar-1993        3.0.2  to  3.0.3
  635. END_OF_FILE
  636. if test 90 -ne `wc -c <'PATCHES'`; then
  637.     echo shar: \"'PATCHES'\" unpacked with wrong size!
  638. fi
  639. # end of 'PATCHES'
  640. fi
  641. if test -f 'README' -a "${1}" != "-c" ; then 
  642.   echo shar: Will not clobber existing file \"'README'\"
  643. else
  644. echo shar: Extracting \"'README'\" \(742 characters\)
  645. sed "s/^X//" >'README' <<'END_OF_FILE'
  646. X$Id: README,v 1.2 92/11/17 20:32:26 wolf Exp $
  647. X
  648. X(for availabilities, see the ANNOUNCE file)
  649. X
  650. If you modify this package PLEASE drop me a note so that there is a
  651. unique up to date version in distribution.
  652. X
  653. There is a discussion list for this product, and Unix LISTSERVs in general,
  654. if you wish to subsribe to it, send a request to <listserv@grasp1.univ-lyon1.fr>
  655. containing in the message body (not in the header) the command:
  656. X
  657. SUB LISTNIX Last First Name
  658. X
  659. X(example: SUB LISTNIX James Bond)
  660. X
  661. Complete installation requires root acces, but the LISTSERV daemon does
  662. X*not* run under super user id.
  663. X
  664. Please read the files COPYRIGHT and AUTHORS for information about the
  665. authors.
  666. X
  667. Christophe Wolfhugel  |  Email: Christophe.Wolfhugel@univ-lyon1.fr
  668. END_OF_FILE
  669. if test 742 -ne `wc -c <'README'`; then
  670.     echo shar: \"'README'\" unpacked with wrong size!
  671. fi
  672. # end of 'README'
  673. fi
  674. if test -f 'VERSIONS' -a "${1}" != "-c" ; then 
  675.   echo shar: Will not clobber existing file \"'VERSIONS'\"
  676. else
  677. echo shar: Extracting \"'VERSIONS'\" \(1735 characters\)
  678. sed "s/^X//" >'VERSIONS' <<'END_OF_FILE'
  679. This document describes how version numbers are handled within TULP.
  680. Should this help you have upgrade processes as easy as possible.
  681. At the end of this document, you'll find the history of the releases.
  682. X
  683. X       3.0.0
  684. X       ! ! !
  685. X       ! ! +- Patchlevel (counts up on every single release)
  686. X       ! +--- New minor features (e.g. options in config)
  687. X       +----- Major features and rewrites (new functionality)
  688. X
  689. Patchlevel
  690. X
  691. X        Count up the patchlevel number to distinguish between the
  692. X        various releases.  This is important so we can tell if the
  693. X        problem someone is experiencing is already supposed to be
  694. X        fixed in his/her version.
  695. X
  696. New minor features
  697. X
  698. X        Count up with new features that will not need anything to be
  699. X        changed in configuration.  New features in this class should
  700. X        have the old behaviour as default.  Anyone can upgrade at this
  701. X        level without needing to change any files.
  702. X
  703. Major features and rewrites
  704. X
  705. X        Count up with such new functionality and features that require
  706. X        changes in any of the configuration files.  This includes all
  707. X        the list configuration files and MTA files (like sendmail.cf,
  708. X        aliases, etc).
  709. X
  710. X-----------------------------------------------------------------------
  711. X
  712. History
  713. X
  714. X 3.0.2  92/12     Second patch to 3.0, lots of cleanup stuff.
  715. X
  716. X 3.0.1  92/11     First patch to 3.0.
  717. X
  718. X 3.0.0  92/09     Third release, new design modifications.
  719. X
  720. X 2.00   92/05     First widely released version.
  721. X
  722. X 1.x0   91-92     Experimental initial release, the current source tree
  723. X                  does not have lots of stuff in common anymore with
  724. X                  the actual one [museum piece even discarded by
  725. X                  the author].
  726. END_OF_FILE
  727. if test 1735 -ne `wc -c <'VERSIONS'`; then
  728.     echo shar: \"'VERSIONS'\" unpacked with wrong size!
  729. fi
  730. # end of 'VERSIONS'
  731. fi
  732. if test -f 'WHERE' -a "${1}" != "-c" ; then 
  733.   echo shar: Will not clobber existing file \"'WHERE'\"
  734. else
  735. echo shar: Extracting \"'WHERE'\" \(1360 characters\)
  736. sed "s/^X//" >'WHERE' <<'END_OF_FILE'
  737. XFollowing sites have accepted to make TULP and its updates available
  738. via anonymous ftp. Please use the one closest to your site when
  739. fetching a copy of the package.
  740. X
  741. X--- Author's sites -------------------------------------------------
  742. X
  743. Anonymous ftp to grasp1.univ-lyon1.fr         [134.214.100.25]
  744. X   /pub/unix/mail/tulp  [directory]
  745. X
  746. Anonymous ftp to lut.fi                       [157.24.10.8]
  747. X   /pub/tulp  [directory]
  748. X
  749. X--- Other shadowing sites ------------------------------------------
  750. X
  751. Anonymous ftp to nic.funet.fi                 [128.214.6.100]
  752. X   /pub/unix/mail/servers/tulp-3.0.?.tar.Z
  753. X
  754. Anonymous ftp to ftphost.comp.vuw.ac.nz        [130.195.5.12]
  755. X   /pub/mail/tulp-3.0.?.tar.Z
  756. X
  757. Anonymous ftp to ftp.vifp.monash.edu.au        [130.194.124.128]
  758. X   /pub/src/mail/tulp  [directory]
  759. X
  760. Anonymous ftp to ftp.zrz.tu-berlin.de         [130.149.4.50]
  761. X   /pub/mail/server/tulp  [directory]
  762. X
  763. X--- New releases ---------------------------------------------------
  764. X
  765. If you wish to be informed of releases of new versions or patches
  766. you may subscribe to the "tulp-dist" mailing list. To do so, send
  767. a mail to <listserv@grasp1.univ-lyon1.fr> with a command like:
  768. X
  769. sub tulp-dist Firstname Lastname
  770. X
  771. The command must not be in the subject of the mail but in the body of
  772. the message. This list will only be informed of new released, discussion
  773. about TULP goes to another list (described in the package).
  774. END_OF_FILE
  775. if test 1360 -ne `wc -c <'WHERE'`; then
  776.     echo shar: \"'WHERE'\" unpacked with wrong size!
  777. fi
  778. # end of 'WHERE'
  779. fi
  780. if test -f 'WORKING' -a "${1}" != "-c" ; then 
  781.   echo shar: Will not clobber existing file \"'WORKING'\"
  782. else
  783. echo shar: Extracting \"'WORKING'\" \(1534 characters\)
  784. sed "s/^X//" >'WORKING' <<'END_OF_FILE'
  785. X$Id: WORKING,v 1.1 92/06/07 23:14:29 kim Exp $
  786. X
  787. The Unix Listserv Program (TULP) is a project involving multiple
  788. development sites.  To aid working with the same sources at many
  789. sites all at once we have used the Revision Control System (RCS)
  790. from the GNU Project.
  791. X
  792. If you plan to make any changes, enhancements or fixes to the
  793. program, we suggest using RCS yourself.  Get the latest sources
  794. for RCS from any GNU redistribution site - we are using v5.6.
  795. Once you have all the files of TULP in one directory, create a
  796. directory called RCS, and check everything into RCS with the -k
  797. option.  This will preserve the RCS keyword values already in
  798. the distributed files.  Here is the procedure:
  799. X
  800. X    % mkdir tulp
  801. X    % chdir tulp
  802. X    % zcat ../tulp-200.tar.Z | tar -xvf -
  803. X    % mkdir RCS
  804. X    % ci -k *
  805. X
  806. Once you have made changes and wish to contribute to the TULP
  807. project, get the changes you have made using rcsdiff against the
  808. original released version.  You might want to start your own
  809. branch if you like to save checkpoint versions of your own work.
  810. X
  811. I do know there is a package called CVS that might handle this
  812. kind of work better.  However, I don't currently have a working
  813. version of CVS installed, and I am not really aware of all the
  814. procedures needed for using CVS.  If someone would like to shed
  815. some light about this, please do so!
  816. X
  817. All code changes are preferred in a context diff format.  Please
  818. send diffs through e-mail to the authors.
  819. X
  820. Kimmo Suominen <Kimmo.Suominen@lut.fi>
  821. Christophe Wolfhugel <Christophe.Wolfhugel@univ-lyon1.fr>
  822. END_OF_FILE
  823. if test 1534 -ne `wc -c <'WORKING'`; then
  824.     echo shar: \"'WORKING'\" unpacked with wrong size!
  825. fi
  826. # end of 'WORKING'
  827. fi
  828. if test -f 'ad.c' -a "${1}" != "-c" ; then 
  829.   echo shar: Will not clobber existing file \"'ad.c'\"
  830. else
  831. echo shar: Extracting \"'ad.c'\" \(2622 characters\)
  832. sed "s/^X//" >'ad.c' <<'END_OF_FILE'
  833. X/*-------------------------------------------------------------------------
  834. X *  Listserv - Unix Mailing List manager (sub-set of FRECP's
  835. X *             Bitnet Listserv tool.
  836. X *
  837. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  838. X *
  839. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  840. X *  copyrights refering to this file.
  841. X *
  842. X *  This program is free software; you can redistribute it and/or modify
  843. X *  it under the terms of the GNU General Public License as published by
  844. X *  the Free Software Foundation; either version 1, or (at your option)
  845. X *  any later version.
  846. X *
  847. X *  This program is distributed in the hope that it will be useful,
  848. X *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  849. X *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  850. X *  GNU General Public License for more details.
  851. X *
  852. X *  You should have received a copy of the GNU General Public License
  853. X *  along with this program; if not, write to the Free Software
  854. X *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  855. X *
  856. X *----------------------------------------------------------------------*/
  857. X
  858. static char rcsid[] = "@(#)$Id: ad.c,v 1.5 93/03/02 22:46:33 wolf Exp $";
  859. X
  860. X#include <stdio.h>
  861. X#include <string.h>
  862. X#include "conf.h"
  863. X#include "ext.h"
  864. X
  865. static char *adrs,*name;
  866. static char line[3][MAXLINE];
  867. X
  868. void adChange(s)
  869. char *s;
  870. X{
  871. X   int state,i,j,quote=0,parlvl=0;
  872. X   char *lns[3],*save=s;
  873. X
  874. X   state=0; memset(line[0],0,sizeof(line));
  875. X   lns[0]=line[0]; lns[1]=line[1]; lns[2]=line[2];
  876. X   while (*s!=0) {
  877. X      if (*s=='"') quote=1-quote;
  878. X      if (quote==1) { *lns[state]++= *s; s++; continue; }
  879. X      switch (*s) {
  880. X      case '<':
  881. X         state=1;
  882. X         break;
  883. X      case '(':
  884. X         parlvl++;
  885. X         state=2;
  886. X     if (parlvl > 1) *lns[state]++ = '(';
  887. X         break;
  888. X      case '>':
  889. X         state=0;
  890. X         break;
  891. X      case ')':
  892. X         if (--parlvl) { *lns[state]++ = ')'; break; }
  893. X         state=0;
  894. X         break;
  895. X      default:
  896. X         *lns[state]++= *s;
  897. X      } /* endswitch */
  898. X      s++;
  899. X   } /* endwhile */
  900. X   lns[0]=line[0]; lns[1]=line[1]; lns[2]=line[2];
  901. X   for (i=0; i<2; i++) {
  902. X      while (*lns[i]==' ') lns[i]++;
  903. X      j=strlen(lns[i]);
  904. X      while (j>0 && lns[i][j-1]==' ') lns[i][--j]=0;
  905. X   } /* endfor */
  906. X   if (lns[1][0]!=0) {    /* Adress between <> */
  907. X      adrs=lns[1];
  908. X      name=lns[0];
  909. X   } else {
  910. X      adrs=lns[0];
  911. X      name=lns[2];
  912. X   } /* endif */
  913. X   if (strchr(adrs,'@')==NULL && strchr(adrs,'!')==NULL) {
  914. X      strcat(adrs,"@");
  915. X      strcat(adrs,HOST);
  916. X   } /* endif */
  917. X   if (*name!=0) sprintf(save,"%s (%s)",adrs,name); else strcpy(save,adrs);
  918. X}
  919. END_OF_FILE
  920. if test 2622 -ne `wc -c <'ad.c'`; then
  921.     echo shar: \"'ad.c'\" unpacked with wrong size!
  922. fi
  923. # end of 'ad.c'
  924. fi
  925. if test -f 'ad.h' -a "${1}" != "-c" ; then 
  926.   echo shar: Will not clobber existing file \"'ad.h'\"
  927. else
  928. echo shar: Extracting \"'ad.h'\" \(356 characters\)
  929. sed "s/^X//" >'ad.h' <<'END_OF_FILE'
  930. X/* $Id: ad.h,v 1.1 92/05/23 14:04:40 kim Exp $
  931. X *
  932. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  933. X *
  934. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  935. X *  copyrights refering to this file.
  936. X *
  937. X * $Log:    ad.h,v $
  938. X * Revision 1.1  92/05/23  14:04:40  kim
  939. X * External definitions from ad.c
  940. X * 
  941. X */
  942. X
  943. extern void adChange(char*);
  944. END_OF_FILE
  945. if test 356 -ne `wc -c <'ad.h'`; then
  946.     echo shar: \"'ad.h'\" unpacked with wrong size!
  947. fi
  948. # end of 'ad.h'
  949. fi
  950. if test -f 'conf.h' -a "${1}" != "-c" ; then 
  951.   echo shar: Will not clobber existing file \"'conf.h'\"
  952. else
  953. echo shar: Extracting \"'conf.h'\" \(6401 characters\)
  954. sed "s/^X//" >'conf.h' <<'END_OF_FILE'
  955. X/* $Id: conf.h,v 1.23 93/03/15 20:54:39 wolf Exp $
  956. X *
  957. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  958. X *
  959. X * Please read the files COPYRIGHT and AUTHORS for the extended
  960. X * copyrights refering to this file.
  961. X * Configuration information for use by LISTSERV.
  962. X * Change these as appropriate for your system.
  963. X *
  964. X */
  965. X
  966. X/*
  967. X * TULPDIR defines the directory where all service files are accessible,
  968. X * such as list of lists, etc... TULP chdir()'s to that at startup.
  969. X */
  970. X
  971. X#define TULPDIR        "/home/listserv/expl"
  972. X
  973. X/*
  974. X * PIDFILE is the file where listserv will write it's pid. This file
  975. X * must be world readable (thus verify the directory tree access) and
  976. X * will not be written by a super-user process, meaning it can't be 
  977. X * placed in /etc or like. The "make install" will create the
  978. X * /usr/local/etc/tulp directory with appropriate rights.
  979. X */
  980. X
  981. X#define PIDFILE    "/usr/local/etc/tulp/tulp.pid"
  982. X
  983. X/*
  984. X * Place where programs sendmail and mailx lie on your system.
  985. X *
  986. X * To run sendmail in background use "-odb" instead of "-odi".
  987. X * This will result in faster LISTSERV replies, but increases
  988. X * load on your system because of the many sendmail processes.
  989. X *
  990. X * Note: with the new "windowed" popen, it is preferable to use 
  991. X * the interactive delivery mode.
  992. X */
  993. X
  994. X#define SENDMAIL  "/usr/lib/sendmail -oi -odi -oem -oMrTULP"
  995. X#define MAILX      "/usr/bin/mailx"
  996. X
  997. X/*
  998. X * Following string is the shutdown command, when sent to the listserv
  999. X * makes a clean and safe shutdown. Useful if there are several admins
  1000. X * some may not have access to the system running it.
  1001. X *
  1002. X * Change this from the default! Multi words is OK.
  1003. X *
  1004. X * If undefined, the option is not hardcoded. Don't forget the 
  1005. X * newline in the string.
  1006. X */
  1007. X
  1008. X#define SHUTDOWN    "shitdown\n"
  1009. X
  1010. X/*
  1011. X * Place, where incoming mail for LISTSERV is spooled.
  1012. X */
  1013. X
  1014. X#define MAILFILE  "/usr/mail/listserv"
  1015. X
  1016. X/*
  1017. X * If you don't have support for syslog, but want a facsimile,
  1018. X * define FAKESYSLOG to be the name of a file to which to log stuff,
  1019. X * otherwise the standard syslog will be used.
  1020. X *
  1021. X *      #define FAKESYSLOG      "/usr/adm/listlog"
  1022. X *
  1023. X */
  1024. X
  1025. X#undef    FAKESYSLOG "syslog"
  1026. X
  1027. X/*
  1028. X * This is frequently used text, rename to fit your needs
  1029. X */
  1030. X
  1031. X#define VERSION    "3.0.3"        /* No longer than this! */
  1032. X
  1033. X/*
  1034. X * If undefined then the statistics junk at the end of a command message
  1035. X * about CPU usage and other stuff will not be sent to the user.
  1036. X * Some dislike to get those lines.
  1037. X */
  1038. X
  1039. X#define CPUTYPE "MyUNIXstuff"    /* Put your CPU type here */
  1040. X
  1041. X/*
  1042. X * NICENESS is the process priority decrement to be used.
  1043. X *
  1044. X * Usually message forwarding is not considered critical and thus
  1045. X * you should choose a value over 0.  If the normal priority on
  1046. X * your system is 20, then 19 is the maximum niceness you should
  1047. X * use, because the lowest priority is usually 39.  Using values
  1048. X * above that (more decrement) may cause unpredictable results.
  1049. X * Under HP-UX your process might get stuck sometimes when using
  1050. X * an invalid value.
  1051. X */
  1052. X
  1053. X#define NICENESS 18
  1054. X
  1055. X/*
  1056. X * BATCHSIZE is the maximum number of recipients in each batch sent.
  1057. X * Does not limit the number of people on any single list.
  1058. X * Use a value between 20 to 50, do NOT exceed 50.
  1059. X * The smaller the value, the more often sendmail will be called.
  1060. X * If you run sendmail in background, a small value results in many
  1061. X * sendmail processes running for a large list!
  1062. X */
  1063. X
  1064. X#define BATCHSIZE 50
  1065. X
  1066. X/*
  1067. X * Define ADD_SENDER, if you want a "Sender: list-errors" header.
  1068. X * This implies the need of the list-errors alias to someone (not listserv).
  1069. X * If your mail agent handles correctly envelopes and if you did trust listserv
  1070. X * and if you use ADD_REQUEST it might be possible to keep this undefined.
  1071. X */
  1072. X
  1073. X#undef    ADD_SENDER        /* Sender */
  1074. X
  1075. X/*
  1076. X * Define ADD_REQUEST, if you prefer envelope sender of listname-request.
  1077. X * Also, listserv job requests will be from listserv-request, so you will
  1078. X * need that defined as an alias to someone (not listserv itself).
  1079. X * This needs listserv as a trusted user in your sendmail configuration.
  1080. X * Add a line like "Tlistserv" after the other T-lines in "sendmail.cf".
  1081. X *
  1082. X * It is strongly recommended to keep this line defined (and create
  1083. X * the appropriate aliases, listserv-request and xxx-request for
  1084. X * each list). By undefining this option you may reate loops
  1085. X * in case of error messages being bounced.  Take care...
  1086. X */
  1087. X
  1088. X#define ADD_REQUEST        /* -fxxx-request to sendmail */
  1089. X
  1090. X/*
  1091. X * If you want the Received: headers to be stripped from incoming
  1092. X * messages (to be redistributed) define this option.
  1093. X * Default is undefined and it is extremely dangerous to strip those
  1094. X * vital lines. You may generate deadly loops, for you and for the
  1095. X * network if you define this.
  1096. X */
  1097. X
  1098. X#undef STRIP_RECEIVED        /* Keep undefined please */
  1099. X
  1100. X/*
  1101. X * If the signals (SIGUSR1 only) are not working fine on you system
  1102. X * (CPU loops or whatsoever) then define following. Instead of
  1103. X * waiting on the deliver signal, listserv will check every
  1104. X * NO_SIGUSR1 seconds for a new message.
  1105. X */
  1106. X
  1107. X/* #define NO_SIGUSR1    60    /* 1 min is a good delay */
  1108. X
  1109. X/*
  1110. X * Choose one of the three ways to get your hostname
  1111. X * 1) USE_GETHOSTNAME   use gethostname followed by gethostbyname
  1112. X * 2) USE_UNAME         use uname followed by gethostbyname
  1113. X * 3) HOST              use the static string - cannot share the executable
  1114. X *
  1115. X * Using gethostbyname in 2) and 3) will result in your fully qualified
  1116. X * domain name (FQDN), if your system is properly configured.  That is,
  1117. X * if you don't use Domain Name Service, the FQDN must be the first name
  1118. X * for your address in /etc/hosts or NIS-map hosts.byname.  This is the
  1119. X * standard way, so there should be no trouble.
  1120. X */
  1121. X
  1122. X#define USE_GETHOSTNAME         /* Use gethostname and gethostbyname */
  1123. X#undef USE_UNAME        /* Use uname and gethostbyname */
  1124. X/* #define HOST "host.foo.bar"    /* Max 50 characters */
  1125. X
  1126. X
  1127. X/*
  1128. X * If your system does not have the strcase functions, define
  1129. X * following option.
  1130. X */
  1131. X
  1132. X#undef    NEED_STRCASE        /* Need strcasecmp and strncasecmp */
  1133. X
  1134. X
  1135. X/*
  1136. X * You should probably better not change following defines, but in case
  1137. X * the defaults do not fit your needs. Be sure of what you do.
  1138. X * Those values have been fetched from Sendmail-IDA (conf.h) and are
  1139. X * unchanged for TULP.
  1140. X */
  1141. X
  1142. X#define    MAXLINE        1024        /* max line length */
  1143. X#define MAXFIELD    4096        /* max total length of a hdr field */
  1144. X
  1145. X/*----- STOP ---- no more modifications below ----- STOP ----------*/
  1146. X
  1147. X#include "internal.h"
  1148. END_OF_FILE
  1149. if test 6401 -ne `wc -c <'conf.h'`; then
  1150.     echo shar: \"'conf.h'\" unpacked with wrong size!
  1151. fi
  1152. # end of 'conf.h'
  1153. fi
  1154. if test -f 'deliver' -a "${1}" != "-c" ; then 
  1155.   echo shar: Will not clobber existing file \"'deliver'\"
  1156. else
  1157. echo shar: Extracting \"'deliver'\" \(809 characters\)
  1158. sed "s/^X//" >'deliver' <<'END_OF_FILE'
  1159. X#!/bin/sh
  1160. X#
  1161. X# $Id: deliver,v 1.3 92/07/14 15:40:33 wolf Exp $
  1162. X#
  1163. X#  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  1164. X#
  1165. X#  Please read the files COPYRIGHT and AUTHORS for the extended
  1166. X#  copyrights refering to this file.
  1167. X#
  1168. X# $Log:    deliver,v $
  1169. X# Revision 1.3  92/07/14  15:40:33  wolf
  1170. X# Changed directory for deliver
  1171. X# 
  1172. X# Revision 1.2  92/07/11  20:12:41  wolf
  1173. X# Added X-Listserv-To: support
  1174. X# 
  1175. X# Revision 1.1  92/02/18  15:51:06  listserv
  1176. X# Initial revision
  1177. X# 
  1178. X# Deliver program -- Used to deliver the incoming message and send signal
  1179. X# to the listserv.
  1180. X#
  1181. X# Customize according to your system.
  1182. X#
  1183. X#
  1184. X# IMPORTANT: put here your LOCAL mailer definition, otherwise you will
  1185. X# create a loop!
  1186. X#
  1187. X( /usr/bin/echo "X-Listserv-To: $1"; /usr/bin/cat - ) | \
  1188. X/usr/bin/mail -d listserv
  1189. X/usr/local/etc/tulp/kilst
  1190. END_OF_FILE
  1191. if test 809 -ne `wc -c <'deliver'`; then
  1192.     echo shar: \"'deliver'\" unpacked with wrong size!
  1193. fi
  1194. # end of 'deliver'
  1195. fi
  1196. if test -f 'ext.h' -a "${1}" != "-c" ; then 
  1197.   echo shar: Will not clobber existing file \"'ext.h'\"
  1198. else
  1199. echo shar: Extracting \"'ext.h'\" \(583 characters\)
  1200. sed "s/^X//" >'ext.h' <<'END_OF_FILE'
  1201. X/* $Id: ext.h,v 1.8 93/03/02 22:33:09 wolf Exp $
  1202. X *
  1203. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  1204. X *
  1205. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  1206. X *  copyrights refering to this file.
  1207. X *
  1208. X */
  1209. X
  1210. X/*
  1211. X * Extern definitions, don't touch!
  1212. X */
  1213. X
  1214. extern char vers[], buf[MAXLINE], rcpt[MAXLINE];
  1215. extern char versFrom[],versHost[];
  1216. extern char From[],To[];
  1217. extern long msgSize;
  1218. extern void versInit();
  1219. X
  1220. extern int  Debug;
  1221. X
  1222. X#ifdef ADD_SENDER
  1223. extern char versSender[];
  1224. X#endif
  1225. X
  1226. X#if defined(USE_UNAME) || defined(USE_GETHOSTNAME)
  1227. extern char myname[];
  1228. X#endif
  1229. END_OF_FILE
  1230. if test 583 -ne `wc -c <'ext.h'`; then
  1231.     echo shar: \"'ext.h'\" unpacked with wrong size!
  1232. fi
  1233. # end of 'ext.h'
  1234. fi
  1235. if test -f 'fakesyslog.c' -a "${1}" != "-c" ; then 
  1236.   echo shar: Will not clobber existing file \"'fakesyslog.c'\"
  1237. else
  1238. echo shar: Extracting \"'fakesyslog.c'\" \(2580 characters\)
  1239. sed "s/^X//" >'fakesyslog.c' <<'END_OF_FILE'
  1240. X#ifndef lint
  1241. static char    *sccsid = "@(#)$Id: fakesyslog.c,v 1.3 92/05/23 14:02:01 kim Exp $";
  1242. X#endif
  1243. X
  1244. X/*
  1245. X * Fake syslog routines for systems that don't have syslog.
  1246. X * Taken from an idea by Paul McKenny, <mckenny@sri-unix.arpa>.
  1247. X * (Unfortunately, Paul, I can't distribute the real syslog code
  1248. X * as you suggested ... sigh.)
  1249. X *
  1250. X * Warning: this file contains joe code that may offend you.
  1251. X */
  1252. X
  1253. X#include "conf.h"
  1254. X
  1255. X#ifdef FAKESYSLOG
  1256. X
  1257. X#include "fakesyslog.h"
  1258. X
  1259. X#include <stdio.h>
  1260. X#include <sys/signal.h>
  1261. X#include <sys/types.h>
  1262. X
  1263. X#ifdef FCNTL
  1264. X#include <fcntl.h>
  1265. X#endif
  1266. X
  1267. extern    int    errno;
  1268. extern    int    sys_nerr;
  1269. extern    char    *sys_errlist[];
  1270. X
  1271. static FILE    *logfp;
  1272. static int    failed = 0;
  1273. static char    *ident = "syslog";
  1274. static int     opt = 0;
  1275. static int    fac = 0;
  1276. X
  1277. extern char    *strcpy(), *strcat(), *ctime();
  1278. extern time_t    time();
  1279. X
  1280. X/* ARGSUSED */
  1281. resetlog(notused)
  1282. X     int notused;
  1283. X{
  1284. X    closelog();
  1285. X    failed = 0;
  1286. X    if (logfp == NULL) {
  1287. X        openlog(ident, opt, fac);
  1288. X        if (logfp == NULL) {
  1289. X            failed = 1;
  1290. X            return;
  1291. X        }
  1292. X    }
  1293. X}
  1294. X
  1295. openlog(newident,logopt,facility)
  1296. X    char *newident;
  1297. X    int logopt, facility;
  1298. X{
  1299. X    logfp = fopen(FAKESYSLOG, "a");
  1300. X
  1301. X    (void)signal(SIGHUP, resetlog);
  1302. X
  1303. X    if (newident && *newident)
  1304. X        ident = newident;
  1305. X    opt = logopt;
  1306. X    fac = facility;
  1307. X}
  1308. X
  1309. closelog()
  1310. X{
  1311. X    if (logfp) {
  1312. X        (void)fclose(logfp);
  1313. X        failed = 0;
  1314. X        logfp = NULL;
  1315. X    }
  1316. X}
  1317. X
  1318. X/*ARGSUSED*/
  1319. setlogmask(maskpri)
  1320. X    int maskpri;
  1321. X{
  1322. X}
  1323. X
  1324. syslog(pri, msg, x1, x2, x3, x4, x5, x6)
  1325. X    int    pri;
  1326. X    char    *msg, *x1, *x2, *x3, *x4, *x5, *x6;
  1327. X{
  1328. X    char        buf[1024];
  1329. X    char        *cp, *bp;
  1330. X    time_t        clock;
  1331. X
  1332. X    if (failed)
  1333. X        return;
  1334. X
  1335. X    if (logfp == NULL) {
  1336. X        openlog(ident, opt, fac);
  1337. X        if (logfp == NULL) {
  1338. X            failed = 1;
  1339. X            return;
  1340. X        }
  1341. X    }
  1342. X
  1343. X    (void) time(&clock);
  1344. X    (void) strcpy(buf, ctime(&clock)+4);
  1345. X    *(bp = buf + 16) = '\0';
  1346. X
  1347. X    (void) sprintf(bp, "localhost %s", ident ? ident : "");
  1348. X    bp += strlen(bp);
  1349. X
  1350. X    if (opt&LOG_PID) {
  1351. X        /* don't cache getpid() - who knows when we'll fork() */
  1352. X        (void) sprintf(bp, "[%d]", getpid());
  1353. X        bp += strlen(bp);
  1354. X    }
  1355. X
  1356. X    if (ident) {
  1357. X        (void) strcat(bp, ": ");
  1358. X        bp += 2;
  1359. X    } else {
  1360. X        (void) strcat(bp, " ");
  1361. X        bp ++;
  1362. X    }
  1363. X
  1364. X    for (cp = msg; *cp; cp++) {
  1365. X        if (*cp == '%' && cp[1] == 'm') {
  1366. X            *bp = '\0';
  1367. X            if (errno >= sys_nerr || errno < 0) {
  1368. X                char    work[32];
  1369. X                (void)sprintf(work, "unknown error #%d", errno);
  1370. X                (void)strcat(bp, work);
  1371. X            } else
  1372. X                (void)strcat(bp, sys_errlist[errno]);
  1373. X            bp = buf + strlen(buf);
  1374. X            cp++;
  1375. X        } else {
  1376. X            *bp++ = *cp;
  1377. X        }
  1378. X    }
  1379. X    *bp = '\0';
  1380. X    /* Ah, the semantic security of C ... */
  1381. X    if (bp[-1] != '\n')
  1382. X        (void) strcat(bp, "\n");
  1383. X
  1384. X    fprintf(logfp, buf, x1, x2, x3, x4, x5, x6);
  1385. X    (void) fflush(logfp);
  1386. X}
  1387. X
  1388. X#endif
  1389. END_OF_FILE
  1390. if test 2580 -ne `wc -c <'fakesyslog.c'`; then
  1391.     echo shar: \"'fakesyslog.c'\" unpacked with wrong size!
  1392. fi
  1393. # end of 'fakesyslog.c'
  1394. fi
  1395. if test -f 'fakesyslog.h' -a "${1}" != "-c" ; then 
  1396.   echo shar: Will not clobber existing file \"'fakesyslog.h'\"
  1397. else
  1398. echo shar: Extracting \"'fakesyslog.h'\" \(1082 characters\)
  1399. sed "s/^X//" >'fakesyslog.h' <<'END_OF_FILE'
  1400. X/*
  1401. X * Fake syslog definitions.
  1402. X *
  1403. X * @(#)fakesyslog.h    1.1    (Berkeley) 12/18/87
  1404. X * $Id: fakesyslog.h,v 1.2 92/05/23 14:06:18 kim Exp $
  1405. X */
  1406. X
  1407. X#ifdef FAKESYSLOG
  1408. X
  1409. X/*
  1410. X * Functions
  1411. X */
  1412. X
  1413. int resetlog(), openlog(), closelog(), setlogmask(), syslog();
  1414. X
  1415. X/*
  1416. X *  Facility codes
  1417. X */
  1418. X
  1419. X#define LOG_KERN    0
  1420. X#define LOG_USER    0
  1421. X#define LOG_MAIL    0
  1422. X#define LOG_DAEMON    0
  1423. X#define LOG_AUTH    0
  1424. X#define LOG_SYSLOG    0
  1425. X#define LOG_LPR        0
  1426. X#define LOG_NEWS    0
  1427. X#define LOG_LOCAL0    0
  1428. X#define LOG_LOCAL1    0
  1429. X#define LOG_LOCAL2    0
  1430. X#define LOG_LOCAL3    0
  1431. X#define LOG_LOCAL4    0
  1432. X#define LOG_LOCAL5    0
  1433. X#define LOG_LOCAL6    0
  1434. X#define LOG_LOCAL7    0
  1435. X
  1436. X#define LOG_NFACILITIES    0
  1437. X#define LOG_FACMASK    0
  1438. X
  1439. X/*
  1440. X *  Priorities
  1441. X */
  1442. X
  1443. X#define LOG_EMERG    0
  1444. X#define LOG_ALERT    0
  1445. X#define LOG_CRIT    0
  1446. X#define LOG_ERR        0
  1447. X#define LOG_WARNING    0
  1448. X#define LOG_NOTICE    0
  1449. X#define LOG_INFO    0
  1450. X#define LOG_DEBUG    0
  1451. X
  1452. X#define LOG_PRIMASK    0
  1453. X
  1454. X/*
  1455. X * arguments to setlogmask.
  1456. X */
  1457. X
  1458. X#define    LOG_MASK(pri)    0
  1459. X#define    LOG_UPTO(pri)    0
  1460. X
  1461. X/*
  1462. X *  Option flags for openlog.
  1463. X */
  1464. X
  1465. X#define    LOG_PID        1
  1466. X#define    LOG_CONS    0
  1467. X#define    LOG_ODELAY    0
  1468. X#define LOG_NDELAY    0
  1469. X#define LOG_NOWAIT    0
  1470. X
  1471. X#endif
  1472. END_OF_FILE
  1473. if test 1082 -ne `wc -c <'fakesyslog.h'`; then
  1474.     echo shar: \"'fakesyslog.h'\" unpacked with wrong size!
  1475. fi
  1476. # end of 'fakesyslog.h'
  1477. fi
  1478. if test -f 'helpfile' -a "${1}" != "-c" ; then 
  1479.   echo shar: Will not clobber existing file \"'helpfile'\"
  1480. else
  1481. echo shar: Extracting \"'helpfile'\" \(1805 characters\)
  1482. sed "s/^X//" >'helpfile' <<'END_OF_FILE'
  1483. X$Revision: 1.3 $
  1484. X
  1485. X                    LISTSERV    --   User's Guide
  1486. X                    -----------------------------
  1487. X
  1488. X                      Version 3, December 1992
  1489. X
  1490. This version of listserv is a subset of the original one that runs under VM
  1491. on lots of Bitnet nodes.
  1492. X
  1493. This tool was firstly designed to act as a relay for Bitnet/Internet lists
  1494. and as an archive-server (on a monthly basis). It's also possible to create
  1495. locally administred lists on node HOST.FOO.BAR, but my package does
  1496. not know of "owners" and other administrative functions. So anyone can
  1497. subscribe and contribute to any list he wishes.
  1498. X
  1499. Commands must be sent to <listserv@host.foo.bar> in a message without
  1500. subject.
  1501. X
  1502. Available verbs are:
  1503. X
  1504. X   HELp                            * Sends this help file
  1505. X   LISt                            * Relayed conferences
  1506. X   REView list                     * Subscribers from a list
  1507. X   SUBscribe list Your name        * Register to a list
  1508. X   SIGnoff   list                  * End of subscription
  1509. X
  1510. X   INDex list                      * Index of files for a list
  1511. X   GET   list file                 * Get a file
  1512. X
  1513. X   ADD list user@host User Name       * Add a User (Owner only)
  1514. X   DEL list user@host           * Delete a User (Owner Only)
  1515. X
  1516. Warning: some lists are archived.
  1517. X
  1518. XExample:
  1519. X
  1520. X  SUB minix-l Christophe Wolfhugel
  1521. X  SIG minix-l
  1522. X  REV ibmpc-l
  1523. X  LIS
  1524. X
  1525. Requests are automatically treated by software, so if you get any problem with
  1526. it don't hesitate to drop me a message. Response time (for local senders) is
  1527. generrally under 1mn, except on very high loads. If you don't get the answer
  1528. fast, maybe the listserv is down...
  1529. X
  1530. XEmail accounts:
  1531. X
  1532. X  listman@host.foo.bar        For any technical or administrative query.
  1533. X  list-errors@host.foo.bar    Error reports.
  1534. X  listserv@host.foo.bar       Requests (SUB, HELP, ...)
  1535. END_OF_FILE
  1536. if test 1805 -ne `wc -c <'helpfile'`; then
  1537.     echo shar: \"'helpfile'\" unpacked with wrong size!
  1538. fi
  1539. # end of 'helpfile'
  1540. fi
  1541. if test -f 'internal.h' -a "${1}" != "-c" ; then 
  1542.   echo shar: Will not clobber existing file \"'internal.h'\"
  1543. else
  1544. echo shar: Extracting \"'internal.h'\" \(339 characters\)
  1545. sed "s/^X//" >'internal.h' <<'END_OF_FILE'
  1546. X/* $Id: internal.h,v 1.4 92/12/04 09:12:35 wolf Exp $
  1547. X *
  1548. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  1549. X *
  1550. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  1551. X *  copyrights refering to this file.
  1552. X *
  1553. X */
  1554. X
  1555. X#if defined(USE_UNAME) || defined(USE_GETHOSTNAME)
  1556. X# define HOST myname        /* Holds your name */
  1557. X#endif
  1558. END_OF_FILE
  1559. if test 339 -ne `wc -c <'internal.h'`; then
  1560.     echo shar: \"'internal.h'\" unpacked with wrong size!
  1561. fi
  1562. # end of 'internal.h'
  1563. fi
  1564. if test -f 'k.c' -a "${1}" != "-c" ; then 
  1565.   echo shar: Will not clobber existing file \"'k.c'\"
  1566. else
  1567. echo shar: Extracting \"'k.c'\" \(1548 characters\)
  1568. sed "s/^X//" >'k.c' <<'END_OF_FILE'
  1569. X/*-------------------------------------------------------------------------
  1570. X *  Listserv - Unix Mailing List manager (sub-set of FRECP's
  1571. X *             Bitnet Listserv tool.
  1572. X *
  1573. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  1574. X *
  1575. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  1576. X *  copyrights refering to this file.
  1577. X *
  1578. X *  This program is free software; you can redistribute it and/or modify
  1579. X *  it under the terms of the GNU General Public License as published by
  1580. X *  the Free Software Foundation; either version 1, or (at your option)
  1581. X *  any later version.
  1582. X *
  1583. X *  This program is distributed in the hope that it will be useful,
  1584. X *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  1585. X *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1586. X *  GNU General Public License for more details.
  1587. X *
  1588. X *  You should have received a copy of the GNU General Public License
  1589. X *  along with this program; if not, write to the Free Software
  1590. X *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1591. X *----------------------------------------------------------------------*/
  1592. X
  1593. static char rcsid[] = "@(#)$Id: k.c,v 1.1 92/02/18 15:51:57 listserv Exp $";
  1594. X
  1595. X/*
  1596. X * $Log:    k.c,v $
  1597. X * Revision 1.1  92/02/18  15:51:57  listserv
  1598. X * Initial revision
  1599. X * 
  1600. X */
  1601. X
  1602. X#include <stdio.h>
  1603. X#include <signal.h>
  1604. X#include "conf.h"
  1605. X
  1606. void main()
  1607. X{
  1608. X   FILE *f;
  1609. X   unsigned int pid;
  1610. X   int rc;
  1611. X
  1612. X   f=fopen(PIDFILE,"r");
  1613. X   if (f==NULL) exit(0);
  1614. X   rc=fscanf(f,"%u",&pid);
  1615. X   fclose(f);
  1616. X   if (rc>0) kill(pid,SIGUSR1);
  1617. X   exit(0);
  1618. X}
  1619. END_OF_FILE
  1620. if test 1548 -ne `wc -c <'k.c'`; then
  1621.     echo shar: \"'k.c'\" unpacked with wrong size!
  1622. fi
  1623. # end of 'k.c'
  1624. fi
  1625. if test -f 'l.h' -a "${1}" != "-c" ; then 
  1626.   echo shar: Will not clobber existing file \"'l.h'\"
  1627. else
  1628. echo shar: Extracting \"'l.h'\" \(389 characters\)
  1629. sed "s/^X//" >'l.h' <<'END_OF_FILE'
  1630. X/* $Id: l.h,v 1.1 92/05/23 14:05:45 kim Exp $
  1631. X *
  1632. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  1633. X *
  1634. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  1635. X *  copyrights refering to this file.
  1636. X *
  1637. X * $Log:    l.h,v $
  1638. X * Revision 1.1  92/05/23  14:05:45  kim
  1639. X * External definitions from l.c
  1640. X * 
  1641. X */
  1642. X
  1643. char *strlwr(char*), *strupr(char*);
  1644. void mailMsg(char*, char*);
  1645. END_OF_FILE
  1646. if test 389 -ne `wc -c <'l.h'`; then
  1647.     echo shar: \"'l.h'\" unpacked with wrong size!
  1648. fi
  1649. # end of 'l.h'
  1650. fi
  1651. if test -f 'lc.h' -a "${1}" != "-c" ; then 
  1652.   echo shar: Will not clobber existing file \"'lc.h'\"
  1653. else
  1654. echo shar: Extracting \"'lc.h'\" \(388 characters\)
  1655. sed "s/^X//" >'lc.h' <<'END_OF_FILE'
  1656. X/* $Id: lc.h,v 1.1 92/05/23 14:03:23 kim Exp $
  1657. X *
  1658. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  1659. X *
  1660. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  1661. X *  copyrights refering to this file.
  1662. X *
  1663. X * $Log:    lc.h,v $
  1664. X * Revision 1.1  92/05/23  14:03:23  kim
  1665. X * External definitions from lc.c
  1666. X * 
  1667. X * External definitions from lc.c
  1668. X */
  1669. X
  1670. extern void listservCmd();
  1671. END_OF_FILE
  1672. if test 388 -ne `wc -c <'lc.h'`; then
  1673.     echo shar: \"'lc.h'\" unpacked with wrong size!
  1674. fi
  1675. # end of 'lc.h'
  1676. fi
  1677. if test -f 'lists' -a "${1}" != "-c" ; then 
  1678.   echo shar: Will not clobber existing file \"'lists'\"
  1679. else
  1680. echo shar: Extracting \"'lists'\" \(70 characters\)
  1681. sed "s/^X//" >'lists' <<'END_OF_FILE'
  1682. X# List of active lists
  1683. X# List name, list description
  1684. X#
  1685. test,Test List
  1686. END_OF_FILE
  1687. if test 70 -ne `wc -c <'lists'`; then
  1688.     echo shar: \"'lists'\" unpacked with wrong size!
  1689. fi
  1690. # end of 'lists'
  1691. fi
  1692. if test -f 'lp.c' -a "${1}" != "-c" ; then 
  1693.   echo shar: Will not clobber existing file \"'lp.c'\"
  1694. else
  1695. echo shar: Extracting \"'lp.c'\" \(7665 characters\)
  1696. sed "s/^X//" >'lp.c' <<'END_OF_FILE'
  1697. X/*-------------------------------------------------------------------------
  1698. X *  Listserv - Unix Mailing List manager (sub-set of FRECP's
  1699. X *             Bitnet Listserv tool.
  1700. X *
  1701. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  1702. X *
  1703. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  1704. X *  copyrights refering to this file.
  1705. X *
  1706. X *  This program is free software; you can redistribute it and/or modify
  1707. X *  it under the terms of the GNU General Public License as published by
  1708. X *  the Free Software Foundation; either version 1, or (at your option)
  1709. X *  any later version.
  1710. X *
  1711. X *  This program is distributed in the hope that it will be useful,
  1712. X *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  1713. X *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1714. X *  GNU General Public License for more details.
  1715. X *
  1716. X *  You should have received a copy of the GNU General Public License
  1717. X *  along with this program; if not, write to the Free Software
  1718. X *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1719. X *----------------------------------------------------------------------*/
  1720. X
  1721. static char rcsid[] = "@(#)$Id: lp.c,v 1.11 92/12/04 09:15:55 wolf Exp $";
  1722. X
  1723. X/*
  1724. X * $Log:    lp.c,v $
  1725. X * Revision 1.11  92/12/04  09:15:55  wolf
  1726. X * Updated some syslog defines
  1727. X * 
  1728. X * Revision 1.10  92/07/14  15:43:09  wolf
  1729. X * Authorized comments in lists; removed third field in file.
  1730. X * 
  1731. X * Revision 1.9  92/06/12  07:11:21  listserv
  1732. X * Initial 2.00 release
  1733. X * 
  1734. X */
  1735. X
  1736. X#include <stdio.h>
  1737. X#include <string.h>
  1738. X#include <stdlib.h>
  1739. X#include <unistd.h>
  1740. X#include <sys/param.h>
  1741. X#include <sys/types.h>
  1742. X#include <sys/stat.h>
  1743. X#include <dirent.h>
  1744. X#include <sys/times.h>
  1745. X#include "conf.h"
  1746. X#include "ext.h"
  1747. X#include "str.h"
  1748. X#include <limits.h>
  1749. X#ifdef FAKESYSLOG
  1750. X# include "fakesyslog.h"
  1751. X#else
  1752. X# include <syslog.h>
  1753. X#endif
  1754. X
  1755. extern char From[],To[];
  1756. X
  1757. struct ITEM {
  1758. X  struct ITEM *next;
  1759. X  char *value;
  1760. X};
  1761. X
  1762. static struct ITEM *commentList=NULL,*commentPtr=NULL;
  1763. static struct ITEM *editorList=NULL,*editorPtr=NULL;
  1764. static struct ITEM *ownerList=NULL,*ownerPtr=NULL;
  1765. static struct ITEM *userList=NULL,*userPtr=NULL;
  1766. X
  1767. static char review[16],send[16],subscription[16];
  1768. static char lname[64],replyto[128],errorsto[128];
  1769. X
  1770. static char buf2[512];
  1771. X
  1772. int IsEditor(char *s)
  1773. X{
  1774. X   struct ITEM *p;
  1775. X
  1776. X   for (p=editorList; p!=NULL; p=p->next) {
  1777. X      if (strspacecmp(p->value,s)==0) return(1);
  1778. X   } /* endfor */
  1779. X   return(0);
  1780. X}
  1781. X
  1782. int IsOwner(char *s)
  1783. X{
  1784. X   struct ITEM *p;
  1785. X
  1786. X   for (p=ownerList; p!=NULL; p=p->next) {
  1787. X      if (strspacecmp(p->value,s)==0) return(1);
  1788. X   } /* endfor */
  1789. X   return(0);
  1790. X}
  1791. X
  1792. int IsUser(char *s)
  1793. X{
  1794. X   struct ITEM *p;
  1795. X
  1796. X   for (p=userList; p!=NULL; p=p->next) {
  1797. X      if (strspacecmp(p->value,s)==0) return(1);
  1798. X   } /* endfor */
  1799. X   return(0);
  1800. X}
  1801. X
  1802. void RewindUserList()
  1803. X{
  1804. X   userPtr=userList;
  1805. X}
  1806. X
  1807. char *GetUser(char *s)
  1808. X{
  1809. X   struct ITEM *p;
  1810. X
  1811. X   if (userPtr==NULL) return(NULL);
  1812. X   p=userPtr; userPtr=userPtr->next;
  1813. X   if (s!=NULL) strcpy(s,p->value);
  1814. X   return(p->value);
  1815. X}
  1816. X
  1817. void RewindCommentList()
  1818. X{
  1819. X   commentPtr=commentList;
  1820. X}
  1821. X
  1822. char *GetComment(char *s)
  1823. X{
  1824. X   struct ITEM *p;
  1825. X
  1826. X   if (commentPtr==NULL) return(NULL);
  1827. X   p=commentPtr; commentPtr=commentPtr->next;
  1828. X   if (s!=NULL) strcpy(s,p->value);
  1829. X   return(p->value);
  1830. X}
  1831. X
  1832. void RewindEditorList()
  1833. X{
  1834. X   editorPtr=editorList;
  1835. X}
  1836. X
  1837. char *GetEditor(char *s)
  1838. X{
  1839. X   struct ITEM *p;
  1840. X
  1841. X   if (editorPtr==NULL) return(NULL);
  1842. X   p=editorPtr; editorPtr=editorPtr->next;
  1843. X   if (s!=NULL) strcpy(s,p->value);
  1844. X   return(p->value);
  1845. X}
  1846. X
  1847. void RewindOwnerList()
  1848. X{
  1849. X   ownerPtr=ownerList;
  1850. X}
  1851. X
  1852. char *GetOwner(char *s)
  1853. X{
  1854. X   struct ITEM *p;
  1855. X
  1856. X   if (ownerPtr==NULL) return(NULL);
  1857. X   p=ownerPtr; ownerPtr=ownerPtr->next;
  1858. X   if (s!=NULL) strcpy(s,p->value);
  1859. X   return(p->value);
  1860. X}
  1861. X
  1862. X
  1863. X/*
  1864. X * Returns:  0 if new entry, 1 if updated.
  1865. X */
  1866. X
  1867. int  AddItem(struct ITEM **head,char *s)
  1868. X{
  1869. X  struct ITEM *p,*q,*r;
  1870. X
  1871. X  q=NULL;
  1872. X  for (p= *head; p!=NULL; p=p->next) {
  1873. X    if (p->value[0]=='#') { q=p; continue; }
  1874. X    if (strspacecmp(s,p->value)==0) {
  1875. X      p->value=(char *)realloc(p->value,strlen(s)+1);
  1876. X      strcpy(p->value,s);
  1877. X      return(1);
  1878. X    } /* endif */
  1879. X    if (strspacecmp(s,p->value)<0) {
  1880. X      r=(struct ITEM *)malloc(sizeof(struct ITEM));
  1881. X      r->value=(char *)malloc(strlen(s)+1);
  1882. X      if (q==NULL) *head=r; else q->next=r;
  1883. X      r->next=p;
  1884. X      strcpy(r->value,s);
  1885. X      return(0);
  1886. X    } /* endif */
  1887. X    q=p;
  1888. X  } /* endfor */
  1889. X  p=(struct ITEM *)malloc(sizeof(struct ITEM));
  1890. X  p->value=(char *)malloc(strlen(s)+1);
  1891. X  p->next=NULL;
  1892. X  strcpy(p->value,s);
  1893. X  if (q!=NULL) q->next=p; else *head=p;
  1894. X  return(0);
  1895. X}
  1896. X
  1897. X
  1898. X/*
  1899. X * Returns 0 is OK, -1 is key not found
  1900. X */
  1901. X
  1902. int DelItem(struct ITEM **head,char *s)
  1903. X{
  1904. X  struct ITEM *p,*q;
  1905. X
  1906. X  q=NULL;
  1907. X  for (p= *head; p!=NULL; p=p->next) {
  1908. X    if (strspacecmp(s,p->value)==0) {
  1909. X      if (q==NULL) *head=p->next; else q->next=p->next;
  1910. X      free(p->value);
  1911. X      free(p);
  1912. X      return(0);
  1913. X    } /* endif */
  1914. X    q=p;
  1915. X  } /* endfor */
  1916. X  return(-1);
  1917. X}
  1918. X
  1919. int  DelUser(char *s)
  1920. X{
  1921. X   return(DelItem(&userList,s));
  1922. X}
  1923. X
  1924. int  AddUser(char *s)
  1925. X{
  1926. X   return(AddItem(&userList,s));
  1927. X}
  1928. X
  1929. void AddEditor(char *s)
  1930. X{
  1931. X   AddItem(&editorList,s);
  1932. X}
  1933. X
  1934. void AddOwner(char *s)
  1935. X{
  1936. X   AddItem(&ownerList,s);
  1937. X}
  1938. X
  1939. void DelList(struct ITEM **head)
  1940. X{
  1941. X  struct ITEM *p;
  1942. X
  1943. X   while (*head!=NULL) {
  1944. X      p= *head; *head=p->next;
  1945. X      free(p->value);
  1946. X      free(p);
  1947. X   } /* endwhile */
  1948. X   *head=NULL;
  1949. X}
  1950. X
  1951. X#define DELIM "# =\r\n\t"
  1952. X
  1953. void parseComment(char *s)
  1954. X{
  1955. X   char *kw;
  1956. X
  1957. X   kw=strtok(buf2,DELIM);
  1958. X   if (kw==NULL) return;
  1959. X   if (strcasecmp(kw,"owner")==0) {
  1960. X      kw=strtok(NULL,DELIM);
  1961. X      if (kw!=NULL) AddItem(&ownerList,kw);
  1962. X      return;
  1963. X   } /* endif */
  1964. X   if (strcasecmp(kw,"editor")==0) {
  1965. X      kw=strtok(NULL,DELIM);
  1966. X      if (kw!=NULL) AddItem(&editorList,kw);
  1967. X      return;
  1968. X   } /* endif */
  1969. X   if (strcasecmp(kw,"review")==0) {
  1970. X      kw=strtok(NULL,DELIM);
  1971. X      if (kw!=NULL) strcpy(review,kw);
  1972. X      return;
  1973. X   } /* endif */
  1974. X   if (strcasecmp(kw,"send")==0) {
  1975. X      kw=strtok(NULL,DELIM);
  1976. X      if (kw!=NULL) strcpy(send,kw);
  1977. X      return;
  1978. X   } /* endif */
  1979. X   if (strcasecmp(kw,"subscription")==0) {
  1980. X      kw=strtok(NULL,DELIM);
  1981. X      if (kw!=NULL) strcpy(subscription,kw);
  1982. X      return;
  1983. X   } /* endif */
  1984. X   if (strcasecmp(kw,"reply-to")==0) {
  1985. X      kw=strtok(NULL,DELIM);
  1986. X      if (kw!=NULL) strcpy(replyto,kw);
  1987. X      return;
  1988. X   } /* endif */
  1989. X   if (strcasecmp(kw,"errors-to")==0) {
  1990. X      kw=strtok(NULL,DELIM);
  1991. X      if (kw!=NULL) strcpy(errorsto,kw);
  1992. X      return;
  1993. X   } /* endif */
  1994. X}
  1995. X
  1996. X
  1997. X/*
  1998. X * Returns: 0 on success, -1 is list.u file not found
  1999. X */
  2000. X
  2001. int  ReadUserList(char *s)
  2002. X{
  2003. X   FILE *f;
  2004. X
  2005. X   strcpy(review,"all");
  2006. X   strcpy(send,"all");
  2007. X   strcpy(subscription,"open");
  2008. X   strcpy(replyto,"list,respect");
  2009. X   errorsto[0]=0;
  2010. X   sprintf(lname,"%s.u",s); f=fopen(lname,"r");
  2011. X   if (f==NULL) { syslog(LOG_ERR,"can't open %s",lname); return(-1); }
  2012. X   while (fgets(buf2,256,f)!=NULL) {
  2013. X      strtok(buf2,"\r\n"); if (buf2[0]==0) continue;
  2014. X      if (buf2[0]=='#') 
  2015. X         { AddItem(&commentList,buf2); parseComment(buf2); continue; }
  2016. X      AddUser(buf2);
  2017. X   } /* endwhile */
  2018. X   fclose(f);
  2019. X   return(0);
  2020. X}
  2021. X
  2022. void WriteUserList()
  2023. X{
  2024. X   FILE *f;
  2025. X
  2026. X   f=fopen("tmpfile","w");
  2027. X   RewindCommentList(); RewindUserList();
  2028. X   while (GetComment(buf2)!=NULL) fprintf(f,"%s\n",buf2);
  2029. X   while (GetUser(buf2)!=NULL) fprintf(f,"%s\n",buf2);
  2030. X   fclose(f);
  2031. X   rename("tmpfile",lname);
  2032. X   unlink("tmpfile");
  2033. X}
  2034. X
  2035. void CloseUserList()
  2036. X{
  2037. X   DelList(&userList);
  2038. X   DelList(&editorList);
  2039. X   DelList(&ownerList);
  2040. X   DelList(&commentList);
  2041. X}
  2042. X
  2043. char *GetSubscription()
  2044. X{
  2045. X   return(subscription);
  2046. X}
  2047. X
  2048. char *GetReview()
  2049. X{
  2050. X   return(review);
  2051. X}
  2052. X
  2053. char *GetSend()
  2054. X{
  2055. X   return(send);
  2056. X}
  2057. X
  2058. char *GetReplyTo()
  2059. X{
  2060. X   return(replyto);
  2061. X}
  2062. X
  2063. char *GetErrorsTo()
  2064. X{
  2065. X   return(errorsto);
  2066. X}
  2067. END_OF_FILE
  2068. if test 7665 -ne `wc -c <'lp.c'`; then
  2069.     echo shar: \"'lp.c'\" unpacked with wrong size!
  2070. fi
  2071. # end of 'lp.c'
  2072. fi
  2073. if test -f 'lp.h' -a "${1}" != "-c" ; then 
  2074.   echo shar: Will not clobber existing file \"'lp.h'\"
  2075. else
  2076. echo shar: Extracting \"'lp.h'\" \(1116 characters\)
  2077. sed "s/^X//" >'lp.h' <<'END_OF_FILE'
  2078. X/* $Id: lp.h,v 1.5 92/11/17 20:13:52 wolf Exp $
  2079. X *
  2080. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  2081. X *
  2082. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  2083. X *  copyrights refering to this file.
  2084. X *
  2085. X * $Log:    lp.h,v $
  2086. X * Revision 1.5  92/11/17  20:13:52  wolf
  2087. X * Corrected horrible bug for IsXXX(). Proto moved from
  2088. X * char * to int as in lp.c
  2089. X * 
  2090. X * Revision 1.4  92/06/12  07:11:28  listserv
  2091. X * Initial 2.00 release
  2092. X * 
  2093. X * 
  2094. X * External definitions from lp.c
  2095. X */
  2096. X
  2097. extern int IsEditor(char *);
  2098. extern int IsOwner(char *);
  2099. extern int IsUser(char *);
  2100. X
  2101. extern void RewindUserList();
  2102. extern void RewindCommentList();
  2103. extern void RewindEditorList();
  2104. extern void RewindOwnerList();
  2105. X
  2106. extern int AddUser(char *);
  2107. extern int DelUser(char *);
  2108. X
  2109. extern void CloseUserList();
  2110. extern int ReadUserList(char *);
  2111. extern void WriteUserList();
  2112. X
  2113. extern char *GetUser(char *);
  2114. extern char *GetComment(char *);
  2115. extern char *GetEditor(char *);
  2116. extern char *GetOwner(char *);
  2117. X
  2118. extern char *GetErrorsTo();
  2119. extern char *GetReplyTo();
  2120. extern char *GetReview();
  2121. extern char *GetSend();
  2122. extern char *GetSubscription();
  2123. END_OF_FILE
  2124. if test 1116 -ne `wc -c <'lp.h'`; then
  2125.     echo shar: \"'lp.h'\" unpacked with wrong size!
  2126. fi
  2127. # end of 'lp.h'
  2128. fi
  2129. if test -f 'messages.h' -a "${1}" != "-c" ; then 
  2130.   echo shar: Will not clobber existing file \"'messages.h'\"
  2131. else
  2132. echo shar: Extracting \"'messages.h'\" \(5426 characters\)
  2133. sed "s/^X//" >'messages.h' <<'END_OF_FILE'
  2134. X/* $Id: messages.h,v 1.3 92/12/04 07:40:16 wolf Exp $
  2135. X *
  2136. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  2137. X *
  2138. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  2139. X *  copyrights refering to this file.
  2140. X *
  2141. X * $Log:    messages.h,v $
  2142. X * Revision 1.3  92/12/04  07:40:16  wolf
  2143. X * Added TULP_MAILPRIVATE and TULP_HDRMAILNAK (Dominique Marant)
  2144. X * 
  2145. X * Revision 1.2  92/07/13  21:20:51  kim
  2146. X * Moved all messages from lc.c into this file.
  2147. X * 
  2148. X * Revision 1.1  1992/07/12  21:51:17  kim
  2149. X * Return messages for various commands.
  2150. X */
  2151. X
  2152. X/* Messages in the execution log. */
  2153. X
  2154. X#define TULP_SYNTAX "\
  2155. X  The syntax you have given is wrong.\n\
  2156. X  To get a help file send the command 'HELP' to listserv.\n"
  2157. X
  2158. X#define TULP_NOSUCHLIST "\
  2159. X  The list specified is not relayed on node %s.\n\
  2160. X  To see all relayed lists send the command 'LIST' to listserv.\n",HOST
  2161. X
  2162. X#define TULP_NONESTORED "\
  2163. X  Sorry, no files are stored on that list.\n"
  2164. X
  2165. X#define TULP_INDNOFILES "\
  2166. X  Sorry, no files were found, an empty index will be sent.\n"
  2167. X
  2168. X#define TULP_GETNOSUCHFILE "\
  2169. X  Sorry, the requested file does not exist.\n"
  2170. X
  2171. X#define TULP_REVPRIVATE "\
  2172. X  Sorry, you are not allowed to review that list.\n\
  2173. X  Only the header of the list will be mailed to you.\n"
  2174. X
  2175. X#define TULP_SUBCLOSED "\
  2176. X  Subscriptions to that list are currently closed.  Please, try again later.\n"
  2177. X
  2178. X#define TULP_SUBFORWARDED "\
  2179. X  Your subscription request has been forwarded to the owner(s) of the list.\n\
  2180. X  You will be sent a notification as soon as you get added to the list.\n"
  2181. X
  2182. X#define TULP_NOTONLIST "\
  2183. X  Sorry, you are not a subscriber to the list, or your address has changed.\n\
  2184. X  Please, resend your request from the original subscription address.\n"
  2185. X
  2186. X#define TULP_SIGDONE "\
  2187. X  You have been removed from the list.\n"
  2188. X
  2189. X#define TULP_SUBALREADY "\
  2190. X  Your subscription record has been updated.\n"
  2191. X
  2192. X#define TULP_NOTOWNER "\
  2193. X  Sorry, you are not an authorized owner on that list.\n"
  2194. X
  2195. X#define TULP_DELSUCCESS "\
  2196. X  The user specified has been successfully deleted from the list.\n"
  2197. X
  2198. X#define TULP_DELNOTONLIST "\
  2199. X  The user specified was not found on the list.\n"
  2200. X
  2201. X#define TULP_DELINCONSISTENT "\
  2202. X  The user was not removed from the list for some reason,\n\
  2203. X  even though the address was found on the list.  Perhaps\n\
  2204. X  there are problems with memory, or there is a bug around.\n"
  2205. X
  2206. X#define TULP_ADDSUCCESS "\
  2207. X  The user specified has been successfully added to the list.\n"
  2208. X
  2209. X#define TULP_ADDALREADY "\
  2210. X  The subscription record has been updated for the user specified.\n"
  2211. X
  2212. X#define TULP_MAILPRIVATE "\
  2213. X  Sorry, you are not a subscriber to the list, or your address has changed.\n\
  2214. X  So, you are not allowed to send mail to this list. \n\
  2215. X  Please, resend your mail from the original subscription address.\n\
  2216. X  \n\
  2217. X    ------ Unsent message follows ------\n"
  2218. X
  2219. X  
  2220. X/* General problems and comments */
  2221. X
  2222. X#define TULP_NOBODY "\
  2223. X  Sorry, I cannot see your message anywhere.\n"
  2224. X
  2225. X#define TULP_NOCOMMANDS "\
  2226. X  Sorry, I could not understand a word you said.\n"
  2227. X
  2228. X#define TULP_EXITING "\
  2229. X  End of commands detected.\n"
  2230. X
  2231. X#define TULP_SAYWHAT "\
  2232. X  Command not understood.\n"
  2233. X
  2234. X#define TULP_OKAY "\
  2235. X  Command executed.\n"
  2236. X
  2237. X/* Totals:
  2238. X * p1 - cpu seconds
  2239. X * p2 - cpu type
  2240. X */
  2241. X
  2242. X#define TULP_TOTAL(p1,p2) "\
  2243. X\n\
  2244. Total CPU time:  %2.2f seconds\n\
  2245. CPU type:        %s\n",p1,p2
  2246. X
  2247. X/* Messages for notifies being mailed
  2248. X *
  2249. X * p1     - subscriber address
  2250. X * p2     - list name
  2251. X * p3 ... - additional
  2252. X */
  2253. X
  2254. X#define TULP_ADDBY(p1,p2,p3) "\
  2255. You have been added to list %s\n\
  2256. as: %s\n\
  2257. by: %s\n\
  2258. X\n",p2,p1,p3
  2259. X
  2260. X#define TULP_SUBUPDATED(p1,p2,p3) "\
  2261. Subject: Your subscription on list '%s'\n\
  2262. To: %s\n\
  2263. X\n\
  2264. Your subscription record on list %s has been updated\n\
  2265. to: %s\n\
  2266. by: %s\n",p2,p1,p2,p1,p3
  2267. X
  2268. X#define TULP_DELREMOVED(p1,p2,p3) "\
  2269. Subject: Your removal from list '%s'\n\
  2270. To: %s\n\
  2271. X\n\
  2272. You have been removed from list %s\n\
  2273. by: %s\n",p2,p1,p2,p3
  2274. X
  2275. X#define TULP_SUBREQUEST(p1,p2,p3) "\
  2276. Subject: SUB %s\n\
  2277. To: Owners of list <%s@%s>\n\
  2278. X\n\
  2279. Dear Owners,\n\
  2280. X\n\
  2281. The following subscription request has been made:\n\
  2282. ADD %s %s %s\n\
  2283. X\n\
  2284. Virtually,\n\
  2285. X\n\
  2286. X    The Listserv Management\n",p2,p2,HOST,p2,p1,p3
  2287. X
  2288. X#define TULP_SIGSUCCESS(p1,p2) "\
  2289. Subject: SIG %s\n\
  2290. To: Owners of list <%s@%s>\n\
  2291. X\n\
  2292. Dear Owners,\n\
  2293. X\n\
  2294. User %s\n\
  2295. has been successfully removed from list %s.\n\
  2296. X\n\
  2297. Virtually,\n\
  2298. X\n\
  2299. X    The Listserv Management\n",p2,p2,HOST,p1,p2
  2300. X
  2301. X#define TULP_SIGFAILED(p1,p2) "\
  2302. Subject: Failed SIG %s\n\
  2303. To: Owners of list <%s@%s>\n\
  2304. X\n\
  2305. Dear Owners,\n\
  2306. X\n\
  2307. User %s\n\
  2308. was not found on list %s.\n\
  2309. X\n\
  2310. Virtually,\n\
  2311. X\n\
  2312. X    The Listserv Management\n",p2,p2,HOST,p1,p2
  2313. X
  2314. X/* Message headers */
  2315. X
  2316. X#define TULP_HDRHELP(p1) "\
  2317. Subject: Usage information\n\
  2318. To: %s\n\
  2319. X\n",p1
  2320. X
  2321. X#define TULP_HDRLIST(p1) "\
  2322. Subject: Relayed lists\n\
  2323. To: %s\n\
  2324. X\n\
  2325. The following lists are realyed at node %s:\n\
  2326. X\n",p1,HOST
  2327. X
  2328. X#define TULP_HDRREV(p1,p2) "\
  2329. Subject: Recipients of list '%s'\n\
  2330. To: %s\n\
  2331. X\n",p2,p1
  2332. X
  2333. X#define TULP_HDRWELCOME(p1,p2) "\
  2334. Subject: Welcome to list '%s'\n\
  2335. To: %s\n\
  2336. X\n",p2,p1
  2337. X
  2338. X#define TULP_HDRINDEX(p1,p2) "\
  2339. Subject: Index of files on list '%s'\n\
  2340. To: %s\n\
  2341. X\n\
  2342. The following files are available on list %s:\n\
  2343. X\n",p2,p1,p2
  2344. X
  2345. X#define TULP_HDRGET(p1,p2,p3) "\
  2346. Subject: File '%s' on list '%s'\n\
  2347. To: %s\n\
  2348. X\n",p3,p2,p1
  2349. X
  2350. X#define TULP_HDROUTPUT(p1) "\
  2351. Subject: Output of your job\n\
  2352. To: %s\n\
  2353. X\n",p1
  2354. X
  2355. X#define TULP_HDRMAILNAK(p1,p2) "\
  2356. Subject: Returned mail: Private list '%s'\n\
  2357. To: %s\n\
  2358. X\n",p2,p1
  2359. X
  2360. X/* $RCSfile: messages.h,v $ */
  2361. END_OF_FILE
  2362. if test 5426 -ne `wc -c <'messages.h'`; then
  2363.     echo shar: \"'messages.h'\" unpacked with wrong size!
  2364. fi
  2365. # end of 'messages.h'
  2366. fi
  2367. if test -f 'popen.c' -a "${1}" != "-c" ; then 
  2368.   echo shar: Will not clobber existing file \"'popen.c'\"
  2369. else
  2370. echo shar: Extracting \"'popen.c'\" \(3875 characters\)
  2371. sed "s/^X//" >'popen.c' <<'END_OF_FILE'
  2372. X/* $Id: popen.c,v 1.11 92/12/04 09:16:30 wolf Exp $
  2373. X *
  2374. X * Derived from the original!  Mod by Wolf & Kim
  2375. X *
  2376. X * Copyright (c) 1988 The Regents of the University of California.
  2377. X * All rights reserved.
  2378. X *
  2379. X * This code is derived from software written by Ken Arnold and
  2380. X * published in UNIX Review, Vol. 6, No. 8.
  2381. X *
  2382. X * Redistribution and use in source and binary forms are permitted
  2383. X * provided that the above copyright notice and this paragraph are
  2384. X * duplicated in all such forms and that any documentation,
  2385. X * advertising materials, and other materials related to such
  2386. X * distribution and use acknowledge that the software was developed
  2387. X * by the University of California, Berkeley.  The name of the
  2388. X * University may not be used to endorse or promote products derived
  2389. X * from this software without specific prior written permission.
  2390. X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  2391. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  2392. X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  2393. X *
  2394. X */
  2395. X
  2396. X/* $Log:    popen.c,v $
  2397. X * Revision 1.11  92/12/04  09:16:30  wolf
  2398. X * Updates syslog defines
  2399. X * 
  2400. X * Revision 1.10  92/11/17  19:55:19  wolf
  2401. X * Changed Debug handling
  2402. X * 
  2403. X * Revision 1.9  92/06/28  19:31:35  wolf
  2404. X * Replaced wait with waitpid (Posix compliant) in order to avoid the
  2405. X * defuncts.
  2406. X * 
  2407. X * Revision 1.8  92/06/12  07:11:31  listserv
  2408. X * Initial 2.00 release
  2409. X * 
  2410. X */
  2411. X
  2412. X#ifndef lint
  2413. static char sccsid[] = "@(#)popen.c    5.7 (Berkeley) 2/14/89";
  2414. X#endif /* not lint */
  2415. X
  2416. X#include "conf.h"
  2417. X#include <sys/types.h>
  2418. X#include <string.h>
  2419. X#include <signal.h>
  2420. X#include <unistd.h>
  2421. X#include <sys/wait.h>
  2422. X#include <stdio.h>
  2423. X#include <stdlib.h>
  2424. X#ifdef FAKESYSLOG
  2425. X# include "fakesyslog.h"
  2426. X#else
  2427. X# include <syslog.h>
  2428. X#endif
  2429. X
  2430. X/*
  2431. X * Special version of popen which avoids call to shell.  This insures noone
  2432. X * may create a pipe to a hidden program as a side effect of a list or dir
  2433. X * command.
  2434. X */
  2435. X
  2436. X#define WINSZ    6
  2437. static int win=0;
  2438. X
  2439. static int *pids=NULL;
  2440. static int fds;
  2441. X
  2442. extern int Debug;
  2443. X
  2444. void reapchild()
  2445. X{
  2446. X   while (waitpid(-1, NULL, WNOHANG) > 0)
  2447. X     win--;
  2448. X}
  2449. X
  2450. void winInc(void)
  2451. X{
  2452. X   win++;
  2453. X}
  2454. X
  2455. XFILE * l_popen(char *program, char *type)
  2456. X{
  2457. X  register char *cp;
  2458. X  FILE *iop;
  2459. X  int argc, pdes[2], pid;
  2460. X  char *argv[100];
  2461. X
  2462. X  if (*type != 'r' && *type != 'w' || type[1])
  2463. X    return(NULL);
  2464. X
  2465. X  if (!pids) {
  2466. X    if ((fds = sysconf(_SC_OPEN_MAX)) <= 0)
  2467. X      return(NULL);
  2468. X    if ((pids = (int *)malloc((u_int)(fds * sizeof(int)))) == NULL)
  2469. X      return(NULL);
  2470. X    memset((char *)pids, 0, fds * sizeof(int));
  2471. X  }
  2472. X  if (pipe(pdes) < 0)
  2473. X    return(NULL);
  2474. X
  2475. X  /* break up string into pieces */
  2476. X  for (argc = 0, cp = program;; cp = NULL)
  2477. X    if (!(argv[argc++] = strtok(cp, " \t\n")))
  2478. X      break;
  2479. X
  2480. X  iop = NULL;
  2481. X  switch(pid = fork()) {
  2482. X  case -1:            /* error */
  2483. X    (void)close(pdes[0]);
  2484. X    (void)close(pdes[1]);
  2485. X    goto pfree;
  2486. X    /* NOTREACHED */
  2487. X  case 0:            /* child */
  2488. X    if (*type == 'r') {
  2489. X      if (pdes[1] != 1) {
  2490. X    dup2(pdes[1], 1);
  2491. X    dup2(pdes[1], 2);    /* stderr, too! */
  2492. X    (void)close(pdes[1]);
  2493. X      }
  2494. X      (void)close(pdes[0]);
  2495. X    } else {
  2496. X      if (pdes[0] != 0) {
  2497. X    dup2(pdes[0], 0);
  2498. X    (void)close(pdes[0]);
  2499. X      }
  2500. X      (void)close(pdes[1]);
  2501. X    }
  2502. X    execv(argv[0], argv);
  2503. X    _exit(1);
  2504. X  }
  2505. X  /* parent; assume fdopen can't fail...  */
  2506. X  if (*type == 'r') {
  2507. X    iop = fdopen(pdes[0], type);
  2508. X    (void)close(pdes[1]);
  2509. X  } else {
  2510. X    iop = fdopen(pdes[1], type);
  2511. X    (void)close(pdes[0]);
  2512. X  }
  2513. X  pids[fileno(iop)] = pid;
  2514. X  win++;
  2515. X
  2516. pfree:    
  2517. X  return(iop);
  2518. X}
  2519. X
  2520. l_pclose(FILE *iop)
  2521. X{
  2522. X  register int fdes;
  2523. X
  2524. X  /*
  2525. X   * pclose returns -1 if stream is not associated with a
  2526. X   * `popened' command, or, if already `pclosed'.
  2527. X   */
  2528. X  if (pids == 0 || pids[fdes = fileno(iop)] == 0)
  2529. X    return(-1);
  2530. X  (void)fclose(iop);
  2531. X   if (Debug != 0)
  2532. X     fprintf(stderr, "l_pclose: win is %d", win);
  2533. X  while (win > WINSZ) sleep(30);
  2534. X  pids[fdes] = 0;
  2535. X  return(0);
  2536. X}
  2537. END_OF_FILE
  2538. if test 3875 -ne `wc -c <'popen.c'`; then
  2539.     echo shar: \"'popen.c'\" unpacked with wrong size!
  2540. fi
  2541. # end of 'popen.c'
  2542. fi
  2543. if test -f 'popen.h' -a "${1}" != "-c" ; then 
  2544.   echo shar: Will not clobber existing file \"'popen.h'\"
  2545. else
  2546. echo shar: Extracting \"'popen.h'\" \(426 characters\)
  2547. sed "s/^X//" >'popen.h' <<'END_OF_FILE'
  2548. X/* $Id: popen.h,v 1.1 92/05/23 14:05:12 kim Exp $
  2549. X *
  2550. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  2551. X *
  2552. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  2553. X *  copyrights refering to this file.
  2554. X *
  2555. X * $Log:    popen.h,v $
  2556. X * Revision 1.1  92/05/23  14:05:12  kim
  2557. X * External definitions from popen.c
  2558. X * 
  2559. X */
  2560. X
  2561. extern FILE *l_popen(char*, char*);
  2562. extern int l_pclose(FILE*);
  2563. extern void winInc(void);
  2564. END_OF_FILE
  2565. if test 426 -ne `wc -c <'popen.h'`; then
  2566.     echo shar: \"'popen.h'\" unpacked with wrong size!
  2567. fi
  2568. # end of 'popen.h'
  2569. fi
  2570. if test -f 'rc.tulp' -a "${1}" != "-c" ; then 
  2571.   echo shar: Will not clobber existing file \"'rc.tulp'\"
  2572. else
  2573. echo shar: Extracting \"'rc.tulp'\" \(386 characters\)
  2574. sed "s/^X//" >'rc.tulp' <<'END_OF_FILE'
  2575. X#!/bin/sh
  2576. X#  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  2577. X#
  2578. X#  Please read the files COPYRIGHT and AUTHORS for the extended
  2579. X#  copyrights refering to this file.
  2580. X#
  2581. X# Startup file -- Used to start the listerv on system launch.
  2582. X# Customize according to your system. On SysV put this file
  2583. X# with a correct name in /etc/rc2.d
  2584. X#
  2585. su - listserv -c /usr/local/etc/tulp/listserv
  2586. END_OF_FILE
  2587. if test 386 -ne `wc -c <'rc.tulp'`; then
  2588.     echo shar: \"'rc.tulp'\" unpacked with wrong size!
  2589. fi
  2590. # end of 'rc.tulp'
  2591. fi
  2592. if test -f 'str.c' -a "${1}" != "-c" ; then 
  2593.   echo shar: Will not clobber existing file \"'str.c'\"
  2594. else
  2595. echo shar: Extracting \"'str.c'\" \(2549 characters\)
  2596. sed "s/^X//" >'str.c' <<'END_OF_FILE'
  2597. X/*-------------------------------------------------------------------------
  2598. X *  Listserv - Unix Mailing List manager (sub-set of FRECP's
  2599. X *             Bitnet Listserv tool.
  2600. X *
  2601. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  2602. X *
  2603. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  2604. X *  copyrights refering to this file.
  2605. X *
  2606. X *  This program is free software; you can redistribute it and/or modify
  2607. X *  it under the terms of the GNU General Public License as published by
  2608. X *  the Free Software Foundation; either version 1, or (at your option)
  2609. X *  any later version.
  2610. X *
  2611. X *  This program is distributed in the hope that it will be useful,
  2612. X *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  2613. X *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  2614. X *  GNU General Public License for more details.
  2615. X *
  2616. X *  You should have received a copy of the GNU General Public License
  2617. X *  along with this program; if not, write to the Free Software
  2618. X *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  2619. X *----------------------------------------------------------------------*/
  2620. X
  2621. static char rcsid[] = "@(#)$Id: str.c,v 1.6 92/09/11 09:51:33 wolf Exp $";
  2622. X
  2623. X/*
  2624. X * $Revision: 1.6 $
  2625. X */
  2626. X
  2627. X#include <stdio.h>
  2628. X#include <string.h>
  2629. X#include <ctype.h>
  2630. X#include "conf.h"
  2631. X
  2632. int strspacecmp(str1, str2)
  2633. char *str1, *str2;
  2634. X{
  2635. X   int c1, c2;
  2636. X
  2637. X   while (1) {
  2638. X      c1 = *str1++; 
  2639. X      c2 = *str2++;
  2640. X      if (isupper(c1)) c1 += 32;
  2641. X      if (isupper(c2)) c2 += 32;
  2642. X      if (c1==' ' || c1=='\t') c1=0;
  2643. X      if (c2==' ' || c2=='\t') c2=0;
  2644. X      if (c1 == c2) {
  2645. X         if (c1==0)
  2646. X            return(0);
  2647. X         continue;
  2648. X      } /* endif */
  2649. X      if (c1 < c2)
  2650. X         return -1;
  2651. X      return 1;
  2652. X   } /* endwhile */
  2653. X}
  2654. X
  2655. X#ifdef NEED_STRCASE
  2656. X
  2657. int strcasecmp(str1, str2)
  2658. char *str1, *str2;
  2659. X{
  2660. X   int c1, c2;
  2661. X
  2662. X   while (1) {
  2663. X      c1 = *str1++;
  2664. X      c2 = *str2++;
  2665. X      if (isupper(c1)) c1 += 32;
  2666. X      if (isupper(c2)) c2 += 32;
  2667. X      if (c1 == c2) {
  2668. X         if (!c1)
  2669. X            return(0);
  2670. X         continue;
  2671. X      } /* endif */
  2672. X      if (c1 < c2)
  2673. X         return -1;
  2674. X      return 1;
  2675. X   } /* endwhile */
  2676. X}
  2677. X
  2678. int strncasecmp(str1, str2, n)
  2679. char *str1, *str2;
  2680. int n;
  2681. X{
  2682. X   int c1, c2;
  2683. X
  2684. X   while (n--) {
  2685. X      c1 = *str1++;
  2686. X      c2 = *str2++;
  2687. X      if (isupper(c1)) c1 += 32;
  2688. X      if (isupper(c2)) c2 += 32;
  2689. X      if (c1 == c2) {
  2690. X         if (!c1)
  2691. X            return(0);
  2692. X         continue;
  2693. X      } /* endif */
  2694. X      if (c1 < c2)
  2695. X         return -1;
  2696. X      return 1;
  2697. X   } /* endwhile */
  2698. X   return(0);
  2699. X}
  2700. X
  2701. X#endif /* NEED_STRCASE */
  2702. END_OF_FILE
  2703. if test 2549 -ne `wc -c <'str.c'`; then
  2704.     echo shar: \"'str.c'\" unpacked with wrong size!
  2705. fi
  2706. # end of 'str.c'
  2707. fi
  2708. if test -f 'str.h' -a "${1}" != "-c" ; then 
  2709.   echo shar: Will not clobber existing file \"'str.h'\"
  2710. else
  2711. echo shar: Extracting \"'str.h'\" \(476 characters\)
  2712. sed "s/^X//" >'str.h' <<'END_OF_FILE'
  2713. X/* $Id: str.h,v 1.1 92/05/23 14:06:53 kim Exp $
  2714. X *
  2715. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  2716. X *
  2717. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  2718. X *  copyrights refering to this file.
  2719. X *
  2720. X * $Log:    str.h,v $
  2721. X * Revision 1.1  92/05/23  14:06:53  kim
  2722. X * External definitions from str.c
  2723. X * 
  2724. X */
  2725. X
  2726. extern int strspacecmp(char*, char*);
  2727. X
  2728. X#ifdef NEED_STRCASE
  2729. extern int strcasecmp(char*, char*);
  2730. extern int strncasecmp(char*, char*, int);
  2731. X#endif
  2732. END_OF_FILE
  2733. if test 476 -ne `wc -c <'str.h'`; then
  2734.     echo shar: \"'str.h'\" unpacked with wrong size!
  2735. fi
  2736. # end of 'str.h'
  2737. fi
  2738. if test -f 'test.u' -a "${1}" != "-c" ; then 
  2739.   echo shar: Will not clobber existing file \"'test.u'\"
  2740. else
  2741. echo shar: Extracting \"'test.u'\" \(208 characters\)
  2742. sed "s/^X//" >'test.u' <<'END_OF_FILE'
  2743. X# Editor       =  ed@foo.bar
  2744. X# Errors-To    =  mistake@foo.bar
  2745. X# Owner        =  you@foo.bar
  2746. X# Review       =  Private
  2747. X# Send         =  Public
  2748. X# Subscription =  Owner
  2749. listman@host.foo.ba  (Listserv Manager)
  2750. END_OF_FILE
  2751. if test 208 -ne `wc -c <'test.u'`; then
  2752.     echo shar: \"'test.u'\" unpacked with wrong size!
  2753. fi
  2754. # end of 'test.u'
  2755. fi
  2756. if test -f 'test.w' -a "${1}" != "-c" ; then 
  2757.   echo shar: Will not clobber existing file \"'test.w'\"
  2758. else
  2759. echo shar: Extracting \"'test.w'\" \(63 characters\)
  2760. sed "s/^X//" >'test.w' <<'END_OF_FILE'
  2761. Welcome to test.
  2762. This message is sent to every new subscriber.
  2763. END_OF_FILE
  2764. if test 63 -ne `wc -c <'test.w'`; then
  2765.     echo shar: \"'test.w'\" unpacked with wrong size!
  2766. fi
  2767. # end of 'test.w'
  2768. fi
  2769. if test -f 'tulp.5' -a "${1}" != "-c" ; then 
  2770.   echo shar: Will not clobber existing file \"'tulp.5'\"
  2771. else
  2772. echo shar: Extracting \"'tulp.5'\" \(6897 characters\)
  2773. sed "s/^X//" >'tulp.5' <<'END_OF_FILE'
  2774. X.TH TULP 5
  2775. X.BY "TULP"
  2776. X.SH NAME
  2777. lists \- list of active public mailing-lists
  2778. X.br
  2779. listname.u \- mailing-list description file
  2780. X.br
  2781. listname.w \- mailing-list welcome message
  2782. X.br
  2783. listname.n \- mailing-list \fBX-Sequence\fP counter
  2784. X.br
  2785. listname (directory) \- directory for archive files
  2786. X.SH DESCRIPTION
  2787. These files are used by TULP in order to ensure proper operation.
  2788. The file \fIlists\fP is unique for the package, whereas the
  2789. X\fIlistname.*\fP need or may (for some of them only) to be created
  2790. for each active mailing-list on the system.
  2791. All files must be in the TULP directory that has been defined in
  2792. X\fBconf.h\fP at compile time, typically this would be
  2793. X\fB~listserv/expl\fP where \fB~listserv\fP is the home directory
  2794. of the user under which you're running TULP.
  2795. X.PP
  2796. X.I Lists
  2797. contains the list of active and public lists on your TULP system. Some
  2798. lists may be hidden and thus not appear if this file. The contents of
  2799. the file are a set of text lines, each line describing a particular
  2800. list. It is recommended to use the alphabetic order when filling
  2801. this file. The indicated data is only informative and used when a user
  2802. issues a \fBLISTS\fP command sent to TULP. Each line is divided into
  2803. two comma separated fields:
  2804. X.RS
  2805. X.nf
  2806. name,description
  2807. X.fi
  2808. X.RE
  2809. X.PP
  2810. The first field is the name of the list. The maximum length of this field
  2811. is the maximum length of a filenam on your system, minus 2. Thus it is
  2812. strongly advised not to use names longer than 12 characters, in order to
  2813. be Posix compliant. If you wish a greater compatibility with Bitnet
  2814. LISTSERV's, the length should not exceed 8 characters.
  2815. The name of the list should correspond to the name of the alias where
  2816. messages to the list have to be sent.
  2817. X.PP
  2818. The description field is a few words (30-40 characters) describing
  2819. briefly the list.
  2820. X.PP
  2821. X.I Listname.u
  2822. is the list definition file (where \fIlistname\fP is to be replaced
  2823. by the real name of the list) for a mailing-list. This file is divided
  2824. into two sections: the comments/flags, and the list of subscribers.
  2825. X.PP
  2826. The first sections, called \fIheader\fP, is either comments or
  2827. special flags describing the behavior of the list.
  2828. A comment line must not begin with one of the
  2829. reserved flags given below. All lines within the header must
  2830. begin with a \fB#\fP sign.
  2831. X.PP
  2832. The format of flags is as follow:
  2833. X.RS
  2834. X.nf
  2835. X# flag = value
  2836. X.fi
  2837. X.RE
  2838. X.PP
  2839. The equal sign car be preceeded or followed by zero or more spaces
  2840. or tabulations. Case is not significant.
  2841. The possible values for \fIflag\fP and
  2842. X\fIvalue\fP are:
  2843. X.IP "Review = Public | Private | Owner"
  2844. This flag describes who may retrieve the list of subsribers to a
  2845. given list. \fIPublic\fP allows anyone to get the list of subscribers.
  2846. X\fIPrivate\fP allows only the subscribers to review a list.
  2847. X\fIOwner\fP gives review access only to the owners of the list.
  2848. Unauthorized users will only receive the header of the list in response
  2849. to their command.
  2850. X.IP "Subscription = Open | Closed | Owner"
  2851. This flag describes how subsription orders are to be handled.
  2852. X\fIOpen\fP allows anyone to join the list.
  2853. X\fIClosed\fP will reject all subscription requests.
  2854. X\fIOwner\fP will forward all subscription requests to the owner of
  2855. the lists for approval.
  2856. X.IP "Send = Public | Private | Editor"
  2857. Defines who may send messages to the list.
  2858. X\fIPublic\fP allows anyone, even non-subscribers, to contribute to the list.
  2859. X\fIPrivate\fP allows only subscribers to contribute to the list.
  2860. X\fIEditor\fP defines a moderated list where only the Editor may
  2861. contribute to. All other incoming messages will be forwarded to the
  2862. XEditor for approval.
  2863. X.IP "Notify = Yes | No | email1,email2,..."
  2864. Not implemented yet.
  2865. X.IP "Periodicity = Yearly | Monthly | Weekly | Daily"
  2866. Not implemented yet. All archives are currently handled only on a
  2867. monthly basis.
  2868. X.IP "Errors-To = Owner,email1,email2,..."
  2869. A part to \fBlistname-request\fP if selected, errors will be reported
  2870. to the indicated persons. Currently only \fIemail1\fP may be
  2871. indicated. We do not recommand the usage of this field yet.
  2872. X.IP "Owner = email"
  2873. Defines an owner of a list. Only one owner must be indicated per line,
  2874. but multiple \fIowner\fP lines are allowed. \fIEmail\fP must be the
  2875. email address of the owner, without any comments.
  2876. X.IP "Editor = email"
  2877. Defines the moderator for the list. Only one editor is currently
  2878. supported.
  2879. X.IP "Reply-To = List | Sender | email [,Respect]"
  2880. Defines how the \fBReply-To\fP header has to be handled.
  2881. X\fIList\fP forces replies to be redirected to the mailing-list.
  2882. Use this with care.
  2883. X\fISender\fP will not alter the \fBReply-To\fP header.
  2884. X\fIEmail\fP will force the reply to the indicated email address. Useful
  2885. when doing redistribution lists.
  2886. X\fIRespect\fP may be added where it makes sense and will not alter
  2887. the \fBReply-To\fP field when there is already one in the
  2888. incoming message.
  2889. X.PP
  2890. The second part of the description file contains the list of
  2891. subscribers given in following format:
  2892. X.RS
  2893. X.nf
  2894. user@host.away.domain (First Lastname)
  2895. X.fi
  2896. X.RE
  2897. X.PP
  2898. Where the first field should be a valid email address and the second
  2899. X(between parenthesis) the comment associated to the subsriber,
  2900. typically the name of the person.
  2901. X.PP
  2902. XExemple of list description file (file \fBsample.u\fP):
  2903. X.RS
  2904. X.nf
  2905. X# List "Sample list"
  2906. X#
  2907. X# Contributions:  <sample@host.dom.ain>
  2908. X# Commandes:      <listserv@host.dom.ain>
  2909. X#
  2910. X# Owner         =  Christophe.Wolfhugel@host.dom.ain
  2911. X# Owner         =  Kimmo.Suominen@host.dom.ain
  2912. X# Send          =  Private
  2913. X# Review        =  Public
  2914. X# Subscription  =  Owner
  2915. X# Reply-To      =  List,Respect
  2916. X#
  2917. chris@there.fr (Christophe Wolfhugel)
  2918. kim@this.fi (Kimmo Suominen)
  2919. pb@mati.fr (Patrice Bere)
  2920. X.fi
  2921. X.RE
  2922. X.PP
  2923. This file might be edited manually only when TULP is not running, in
  2924. order to avoid possible access conflicts and damage to the file.
  2925. X.PP
  2926. This file is mandatory and must be unique for each list you are
  2927. hosting (wether it's described in the file \fIlists\fP or not).
  2928. X.PP
  2929. X.I Listname.w
  2930. is the welcome message that is to be sent to each new subscriber.
  2931. There are no restrictions on its contents, but it's a good idea
  2932. to remind the newcomer at least how to get off the list.
  2933. X.PP
  2934. This file is also mandatory.
  2935. X.PP
  2936. X.I Listname.n
  2937. when existing is the counter for the \fBX-Sequence\fP field to be added
  2938. to each forwarded message. It has to be created containing the
  2939. first sequence number to be used, minus 1. If unexisting, then no
  2940. X\fBX-Sequence\fP header will be added.
  2941. X.PP
  2942. X.I Listname (directory)
  2943. All messages sent to the list will be archives if, and only if,
  2944. this directory exists. The name of the log file will be
  2945. X\fIlogyymm\fP where \fIyy\fP is the current year and
  2946. X\fImm\fP the current month. Exemple: \fItest-list/log9207\fP.
  2947. X.SH SEE ALSO
  2948. tulp(8)
  2949. X.SH HISTORY
  2950. Written by Kimmo Suominen <Kimmo.Suominen@lut.fi>
  2951. and Christophe Wolfhugel <Christophe.Wolfhugel@univ-lyon1.fr>
  2952. for TULP.
  2953. X.de R$
  2954. This is revision \\$3, dated \\$4.
  2955. X..
  2956. X.R$ $Id: tulp.5,v 1.2 92/07/14 13:41:24 wolf Exp $
  2957. END_OF_FILE
  2958. if test 6897 -ne `wc -c <'tulp.5'`; then
  2959.     echo shar: \"'tulp.5'\" unpacked with wrong size!
  2960. fi
  2961. # end of 'tulp.5'
  2962. fi
  2963. if test -f 'tulp.8' -a "${1}" != "-c" ; then 
  2964.   echo shar: Will not clobber existing file \"'tulp.8'\"
  2965. else
  2966. echo shar: Extracting \"'tulp.8'\" \(2444 characters\)
  2967. sed "s/^X//" >'tulp.8' <<'END_OF_FILE'
  2968. X.TH TULP 8
  2969. X.BY "TULP"
  2970. X.SH NAME
  2971. listserv \- TULP main daemon
  2972. X.br
  2973. deliver \- deliver script to be called by the MTA
  2974. X.br
  2975. rc.tulp \- startup script
  2976. X.br
  2977. kilst \- signal generator for the listserv daemon
  2978. X.SH SYNOPSIS
  2979. listserv
  2980. X.br
  2981. deliver listname
  2982. X.br
  2983. rc.tulp
  2984. X.br
  2985. kilst
  2986. X.SH DESCRIPTION
  2987. These executables or shell scripts are the service applications
  2988. used by TULP to ensure proper operation. Installation and configuration
  2989. procedures for TULP are described in the separate file INSTALL.
  2990. X.PP
  2991. X.I Listserv
  2992. is the main executable. It is a straight running daemon that will
  2993. handle all incoming messages, commands or data to be distributed to
  2994. the lists. To start the daemon just type \fIlistserv\fP at the
  2995. command prompt. This assumes that the daemon you already have the
  2996. appropriate priviledge, not root.
  2997. X.PP
  2998. X.I Deliver
  2999. is generally called from the MTA and will deliver an incoming message
  3000. to TULP. The parameter to be furnished to \fIdeliver\fP is the
  3001. name of the list (or \fBlistserv\fP) to which the message is to be
  3002. delivered. Examples:
  3003. X.RS
  3004. X.nf
  3005. X\fIdeliver listserv\fP will deliver a command to TULP.
  3006. X
  3007. X\fIdeliver test-list\fP will deliver a message for \fBtest-list\fP
  3008. to TULP
  3009. X.fi
  3010. X.RE
  3011. X.PP
  3012. The message has to be piped to \fIdeliver\fP. If you are running
  3013. X\fBSendmail\fP, your \fIaliases\fP file could look like:
  3014. X.RS
  3015. X.nf
  3016. listserv:       "|/usr/local/etc/deliver listserv"
  3017. test-list:      "|/usr/local/etc/deliver test-list"
  3018. real-list:      "|/usr/local/etc/deliver real-list"
  3019. X.fi
  3020. X.RE
  3021. X.PP
  3022. X.I Rc.tulp
  3023. is the startup script that is to be used, to start TULP properly.
  3024. Typically this script would be called from \fI/etc/rc.local\fP
  3025. or any similar file on your system.
  3026. Rc.tulp must be started as root, in order to be able to set the
  3027. proper UID before starting the \fIlistserv\fP daemon.
  3028. X.PP
  3029. X.I Kilst
  3030. is not to be used by the user. This setuid program is called by
  3031. the \fIdeliver\fP script in order to send SIGUSR1 to the TULP
  3032. daemon, indicating that a message has just arrived and needs
  3033. handling. On some systems with unreliable signals, this feature
  3034. might, if not should, be disabled.
  3035. X.SH INITIAL SETUP, INSTALLATION, CREATING LISTS
  3036. See the file \fBINSTALL\fP that came with the distribution
  3037. package of TULP.
  3038. X.SH SEE ALSO
  3039. tulp(5)
  3040. X.SH HISTORY
  3041. Written by Kimmo Suominen <Kimmo.Suominen@lut.fi>
  3042. and Christophe Wolfhugel <Christophe.Wolfhugel@univ-lyon1.fr>
  3043. for TULP.
  3044. X.de R$
  3045. This is revision \\$3, dated \\$4.
  3046. X..
  3047. X.R$ $Id: tulp.8,v 1.1 92/07/14 13:42:55 wolf Exp $
  3048. END_OF_FILE
  3049. if test 2444 -ne `wc -c <'tulp.8'`; then
  3050.     echo shar: \"'tulp.8'\" unpacked with wrong size!
  3051. fi
  3052. # end of 'tulp.8'
  3053. fi
  3054. if test -f 'vers.c' -a "${1}" != "-c" ; then 
  3055.   echo shar: Will not clobber existing file \"'vers.c'\"
  3056. else
  3057. echo shar: Extracting \"'vers.c'\" \(2213 characters\)
  3058. sed "s/^X//" >'vers.c' <<'END_OF_FILE'
  3059. X/*-------------------------------------------------------------------------
  3060. X *  Listserv - Unix Mailing List manager (sub-set of FRECP's
  3061. X *             Bitnet Listserv tool).
  3062. X *
  3063. X *  Copyright (C) 1991,1992  Kimmo Suominen, Christophe Wolfhugel
  3064. X *
  3065. X *  Please read the files COPYRIGHT and AUTHORS for the extended
  3066. X *  copyrights refering to this file.
  3067. X *
  3068. X *  This program is free software; you can redistribute it and/or modify
  3069. X *  it under the terms of the GNU General Public License as published by
  3070. X *  the Free Software Foundation; either version 1, or (at your option)
  3071. X *  any later version.
  3072. X *
  3073. X *  This program is distributed in the hope that it will be useful,
  3074. X *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  3075. X *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  3076. X *  GNU General Public License for more details.
  3077. X *
  3078. X *  You should have received a copy of the GNU General Public License
  3079. X *  along with this program; if not, write to the Free Software
  3080. X *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  3081. X *----------------------------------------------------------------------*/
  3082. X
  3083. static char rcsid[] = "@(#)$Id: vers.c,v 1.3 92/09/11 09:50:34 wolf Exp $";
  3084. X
  3085. X/*
  3086. X * $Revision: 1.3 $
  3087. X */
  3088. X
  3089. X#include <stdio.h>
  3090. X#include "conf.h"
  3091. X
  3092. char vers[64], versFrom[116];
  3093. X#ifdef ADD_SENDER
  3094. char versSender[124];
  3095. X#endif
  3096. X
  3097. X#include <sys/param.h>
  3098. X#ifdef USE_UNAME
  3099. X# include <sys/utsname.h>
  3100. X#endif
  3101. X#if defined(USE_UNAME) || defined(USE_GETHOSTNAME)
  3102. X# include <sys/types.h>
  3103. X# include <sys/socket.h>
  3104. X# include <netdb.h>
  3105. char myname[MAXHOSTNAMELEN];
  3106. X#endif
  3107. X
  3108. void versInit()
  3109. X{
  3110. X#if defined(USE_UNAME) || defined(USE_GETHOSTNAME)
  3111. X  struct hostent *netname;
  3112. X#endif
  3113. X#ifdef USE_GETHOSTNAME
  3114. X  char name[MAXHOSTNAMELEN];
  3115. X#endif
  3116. X#ifdef USE_UNAME
  3117. X  struct utsname name;
  3118. X  uname(&name);
  3119. X  netname = gethostbyname(name.nodename);
  3120. X#endif
  3121. X#ifdef USE_GETHOSTNAME
  3122. X  gethostname(name, MAXHOSTNAMELEN);
  3123. X  netname = gethostbyname(name);
  3124. X#endif
  3125. X#if defined(USE_UNAME) || defined(USE_GETHOSTNAME)
  3126. X  strcpy(myname, netname->h_name);
  3127. X#endif
  3128. X  sprintf(vers,"Listserv v%s",VERSION);
  3129. X  sprintf(versFrom,"From: listserv@%s (%s)\n",HOST,vers);
  3130. X#ifdef ADD_SENDER
  3131. X  sprintf(versSender,"Sender: list-errors@%s\n",HOST);
  3132. X#endif
  3133. X}
  3134. END_OF_FILE
  3135. if test 2213 -ne `wc -c <'vers.c'`; then
  3136.     echo shar: \"'vers.c'\" unpacked with wrong size!
  3137. fi
  3138. # end of 'vers.c'
  3139. fi
  3140. echo shar: End of archive 1 \(of 2\).
  3141. cp /dev/null ark1isdone
  3142. MISSING=""
  3143. for I in 1 2 ; do
  3144.     if test ! -f ark${I}isdone ; then
  3145.     MISSING="${MISSING} ${I}"
  3146.     fi
  3147. done
  3148. if test "${MISSING}" = "" ; then
  3149.     echo You have unpacked both archives.
  3150.     rm -f ark[1-9]isdone
  3151. else
  3152.     echo You still need to unpack the following archives:
  3153.     echo "        " ${MISSING}
  3154. fi
  3155. ##  End of shell archive.
  3156. exit 0
  3157.